Basic Arithmetic $x = ++$x ‡1 $x = $x++ ‡1 $x = --$x ‡1 $x = $x-- ‡1 -$x $x + 0 $x - 0 $x * 1 $x / 1 $x % 1 Basic Arithmetic
Basic Arithmetic $x = ++$x ‡1 $x = $x++ ‡1 $x = --$x ‡1 $x = $x-- ‡1 -$x $x + 0 $x - 0 $x * 1 $x / 1 $x % 1 Basic Arithmetic
$x = null : ( = NULL )
1 null null null 0
0 0
0
0
0
$x = null : ( = NULL )
$x = null : ( = NULL )
1 null null null 0
0 0
0
0
0
$x = null : ( = NULL )
$x = bool : ( = false )
b false
b false
b false
b false
0
0 0
0
0
0
$x = bool : ( = false )
$x = bool : 1 ( = true )
b true
b true
b true
b true
-1
1 1
1
1
0
$x = bool : 1 ( = true )
$x = int : 1
2 1 0 1 -1
1 1
1
1
0
$x = int : 1
$x = int : 0
1 0 -1 0 0
0 0
0
0
0
$x = int : 0
$x = int : -1
0 -1 -2 -1 1
-1 -1
-1
-1
0
$x = int : -1
$x = int : 42
43 42 41 42 -42
42 42
42
42
0
$x = int : 42
†i8$x = int : 13369593
13369594 13369593 13369592 13369593 -13369593
13369593 13369593
13369593
13369593
0
†i8$x = int : 13369593
†i9$x = int : 42
43 42 41 42 -42
42 42
42
42
0
†i9$x = int : 42
†ia$x = int : 57
58 57 56 57 -57
57 57
57
57
0
†ia$x = int : 57
$x = float : 1.3
2.3 1.3 0.3 1.3 -1.3
1.3 1.3
1.3
1.3
0
$x = float : 1.3
$x = float : 0.005
1.005 0.005 -0.995 0.005 -0.005
0.005 0.005
0.005
0.005
0
$x = float : 0.005
$x = float : 0
1 0 -1 0 0
0 0
0
0
0
$x = float : 0
$x = float : -1.3
-0.3 -1.3 -2.3 -1.3 1.3
-1.3 -1.3
-1.3
-1.3
0
$x = float : -1.3
†f5$x = float : NAN
NAN NAN NAN NAN NAN
NAN NAN
NAN
NAN
0
†f5$x = float : NAN
†f6$x = float : NAN
NAN NAN NAN NAN NAN
NAN NAN
NAN
NAN
0
†f6$x = float : NAN
†f7$x = float : -INF
-INF -INF -INF -INF INF
-INF -INF
-INF
-INF
0
†f7$x = float : -INF
†f8$x = float : INF
INF INF INF INF -INF
INF INF
INF
INF
0
†f8$x = float : INF
†f9$x = float : 123450000
123450001 123450000 123449999 123450000 -123450000
123450000 123450000
123450000
123450000
0
†f9$x = float : 123450000
$x = string[0] : ‘’
‘1’
‘’
-1 ‘’
0
0 0
0
0
0
$x = string[0] : ‘’
$x = string[1] : ‘ ’
‘ ’
‘ ’
‘ ’
‘ ’
0
0 0
0
0
0
$x = string[1] : ‘ ’
$x = string[2] : ‘ 1’
2 ‘ 1’
0 ‘ 1’
-1
1 1
1
1
0
$x = string[2] : ‘ 1’
$x = string[3] : ‘ 3 ’
‘ 3 ’
‘ 3 ’
‘ 3 ’
‘ 3 ’
-3
3 3
3
3
0
$x = string[3] : ‘ 3 ’
$x = string[1] : ‘1’
2 ‘1’
0 ‘1’
-1
1 1
1
1
0
$x = string[1] : ‘1’
$x = string[1] : ‘0’
1 ‘0’
-1 ‘0’
0
0 0
0
0
0
$x = string[1] : ‘0’
$x = string[2] : ‘-1’
0 ‘-1’
-2 ‘-1’
1
-1 -1
-1
-1
0
$x = string[2] : ‘-1’
$x = string[2] : ‘42’
43 ‘42’
41 ‘42’
-42
42 42
42
42
0
$x = string[2] : ‘42’
$x = string[3] : ‘1.3’
2.3 ‘1.3’
0.3 ‘1.3’
-1.3
1.3 1.3
1.3
1.3
0
$x = string[3] : ‘1.3’
$x = string[3] : ‘0.0’
1 ‘0.0’
-1 ‘0.0’
0
0 0
0
0
0
$x = string[3] : ‘0.0’
$x = string[6] : ‘-1.305’
-0.305 ‘-1.305’
-2.305 ‘-1.305’
1.305
-1.305 -1.305
-1.305
-1.305
0
$x = string[6] : ‘-1.305’
$x = string[4] : ‘true’
‘truf’
‘true’
‘true’
‘true’
0
0 0
0
0
0
$x = string[4] : ‘true’
$x = string[5] : ‘false’
‘falsf’
‘false’
‘false’
‘false’
0
0 0
0
0
0
$x = string[5] : ‘false’
$x = string[4] : ‘null’
‘nulm’
‘null’
‘null’
‘null’
0
0 0
0
0
0
$x = string[4] : ‘null’
$x = string[6] : ‘123str’
‘123sts’
‘123str’
‘123str’
‘123str’
-123
123 123
123
123
0
$x = string[6] : ‘123str’
$x = string[6] : ‘str123’
‘str124’
‘str123’
‘str123’
‘str123’
0
0 0
0
0
0
$x = string[6] : ‘str123’
$x = string[10] : ‘123, "str"’
‘123, "str"’
‘123, "str"’
‘123, "str"’
‘123, "str"’
-123
123 123
123
123
0
$x = string[10] : ‘123, "str"’
$x = string[8] : ‘0xCC00F9’
13369594 ‘0xCC00F9’
13369592 ‘0xCC00F9’
-13369593
13369593 13369593
13369593
13369593
0
$x = string[8] : ‘0xCC00F9’
$x = string[4] : ‘0123’
124 ‘0123’
122 ‘0123’
-123
123 123
123
123
0
$x = string[4] : ‘0123’
$x = array()
array()
array()
array()
array()

Fatal error ( #2 )

Fatal error ( #2 )

Fatal error ( #2 )

Fatal error ( #2 )

Fatal error ( #2 )
0
$x = array()
$x = Array: (
    [1 (int)] => string[6] : ‘string’
)
Array: (
  [1] => ‘string’
)
Array: (
  [1] => ‘string’
)
Array: (
  [1] => ‘string’
)
Array: (
  [1] => ‘string’
)

Fatal error ( #2 )

Fatal error ( #2 )

Fatal error ( #2 )

Fatal error ( #2 )

Fatal error ( #2 )
0
$x = Array: (
    [1 (int)] => string[6] : ‘string’
)
$x = Array: (
    [0 (int)] => bool : ( = false )
    [1 (int)] => int : 1
    [2 (int)] => float : 1.3
    [3 (int)] => string[6] : ‘123str’
    [4 (int)] => string[6] : ‘str123’
    [5 (int)] => null : ( = NULL )
)
Array: (
  [0] => b false
  [1] => 1
  [2] => 1.3
  [3] => ‘123str’
  [4] => ‘str123’
  [5] => null
)
Array: (
  [0] => b false
  [1] => 1
  [2] => 1.3
  [3] => ‘123str’
  [4] => ‘str123’
  [5] => null
)
Array: (
  [0] => b false
  [1] => 1
  [2] => 1.3
  [3] => ‘123str’
  [4] => ‘str123’
  [5] => null
)
Array: (
  [0] => b false
  [1] => 1
  [2] => 1.3
  [3] => ‘123str’
  [4] => ‘str123’
  [5] => null
)

Fatal error ( #2 )

Fatal error ( #2 )

Fatal error ( #2 )

Fatal error ( #2 )

Fatal error ( #2 )
0
$x = Array: (
    [0 (int)] => bool : ( = false )
    [1 (int)] => int : 1
    [2 (int)] => float : 1.3
    [3 (int)] => string[6] : ‘123str’
    [4 (int)] => string[6] : ‘str123’
    [5 (int)] => null : ( = NULL )
)
$x = Object: (
    Class: stdClass (
    )
)
Object: (
  Class: stdClass (
  )
)
Object: (
  Class: stdClass (
  )
)
Object: (
  Class: stdClass (
  )
)
Object: (
  Class: stdClass (
  )
)
-1

#3 )
1
#3 )
1

#3 )
1

#3 )
1

#3 )
0

#3 )
$x = Object: (
    Class: stdClass (
    )
)
$x = Object: (
    Class: TestObjectToString (
        property: test3 = string[11] : ‘some string’
        property: test1 = null : ( = NULL )
        property: test2 = bool : 1 ( = true )
        method: __toString
        method: print_it
    )
)
Object: (
  Class: TestObjectToString (
    property: test3 = ‘some string’
    property: test1 = null     property: test2 = b true
    method: __toString
    method: print_it
  )
)
Object: (
  Class: TestObjectToString (
    property: test3 = ‘some string’
    property: test1 = null     property: test2 = b true
    method: __toString
    method: print_it
  )
)
Object: (
  Class: TestObjectToString (
    property: test3 = ‘some string’
    property: test1 = null     property: test2 = b true
    method: __toString
    method: print_it
  )
)
Object: (
  Class: TestObjectToString (
    property: test3 = ‘some string’
    property: test1 = null     property: test2 = b true
    method: __toString
    method: print_it
  )
)
-1

#3 )
1
#3 )
1

#3 )
1

#3 )
1

#3 )
0

#3 )
$x = Object: (
    Class: TestObjectToString (
        property: test3 = string[11] : ‘some string’
        property: test1 = null : ( = NULL )
        property: test2 = bool : 1 ( = true )
        method: __toString
        method: print_it
    )
)
$x = resource : Resource id #10 ( = RESOURCE )
Resource id #10
Resource id #10
Resource id #10
Resource id #10
-10
10 10
10
10
0
$x = resource : Resource id #10 ( = RESOURCE )
$x = Object: (
    Class: SplBool (
        property: __default = bool : ( = false )
        method: getConstList
        method: __construct
    )
)
Object: (
  Class: SplBool (
    property: __default = b false
    method: getConstList
    method: __construct
  )
)
Object: (
  Class: SplBool (
    property: __default = b false
    method: getConstList
    method: __construct
  )
)
Object: (
  Class: SplBool (
    property: __default = b false
    method: getConstList
    method: __construct
  )
)
Object: (
  Class: SplBool (
    property: __default = b false
    method: getConstList
    method: __construct
  )
)
0
Fatal error #4 0
0
0
0
$x = Object: (
    Class: SplBool (
        property: __default = bool : ( = false )
        method: getConstList
        method: __construct
    )
)
$x = Object: (
    Class: SplBool (
        property: __default = bool : 1 ( = true )
        method: getConstList
        method: __construct
    )
)
Object: (
  Class: SplBool (
    property: __default = b true
    method: getConstList
    method: __construct
  )
)
Object: (
  Class: SplBool (
    property: __default = b true
    method: getConstList
    method: __construct
  )
)
Object: (
  Class: SplBool (
    property: __default = b true
    method: getConstList
    method: __construct
  )
)
Object: (
  Class: SplBool (
    property: __default = b true
    method: getConstList
    method: __construct
  )
)
-1
Fatal error #4 1
1
1
0
$x = Object: (
    Class: SplBool (
        property: __default = bool : 1 ( = true )
        method: getConstList
        method: __construct
    )
)