Перейти к содержанию

PHP Шпаргалки: различия между версиями

148 байт убрано ,  22:44, 2 ноября 2022
(→‎Приведение типов: Доработка таблицы)
Строка 126: Строка 126:
| string(0) ""
| string(0) ""


| []
| []*
| {}
| {}**
|-
|-
! true
! true
Строка 224: Строка 224:
| string(3) "INF"
| string(3) "INF"


| array(1) {
| [INF]
  [0]=>
  float(INF)
}


| object(stdClass)#5 (1) {
| {"scalar":INF}
  ["scalar"]=>
  float(INF)
}


|-
|-
Строка 246: Строка 240:
| string(3) "NAN"
| string(3) "NAN"


| array(1) {
| [NAN]
  [0]=>
  float(NAN)
}


| object(stdClass)#5 (1) {
| {"scalar":NAN}
  ["scalar"]=>
  float(NAN)
}


|-
|-
Строка 350: Строка 338:
| float(0)
| float(0)


| style="background-color: #ffff66"| string(5) "Array" + Warning
| style="background-color: #ffff66"| string(5) "Array" + E_WARNING
| []
| []
| {}
| {}
Строка 363: Строка 351:
| float(1)
| float(1)


| style="background-color: #ffff66"| string(5) "Array" + Warning
| style="background-color: #ffff66"| string(5) "Array" + E_WARNING
| [0]
| [0]
| {"0":0}
| {"0":0}
Строка 376: Строка 364:
| float(1)
| float(1)


| style="background-color: #ffff66"| string(5) "Array" + Warning
| style="background-color: #ffff66"| string(5) "Array" + E_WARNING
| ["abc"]
| ["abc"]
| {"0":"abc"}
| {"0":"abc"}
Строка 389: Строка 377:
| float(1)
| float(1)


| style="background-color: #ffff66"| string(5) "Array" + Warning
| style="background-color: #ffff66"| string(5) "Array" + E_WARNING
| {"a":"b"}
| ["a"=>"b"]
| {"a":"b"}
| {"a":"b"}
|-
|-
Строка 402: Строка 390:
| float(1)
| float(1)


| style="background-color: #ffff66"| string(5) "Array" + Warning
| style="background-color: #ffff66"| string(5) "Array" + E_WARNING
| [{"a":"b"}]
| [["a"=>"b]]
| {"0":{"a":"b"}}
| {"0":["a"=>"b"]}
|-
|-
! new stdClass()
! new stdClass()
Строка 412: Строка 400:


| style="background-color: #ffff66"| int(1) + Warning
| style="background-color: #ffff66"| int(1) + Warning
| style="background-color: #ffff66"| float(1) + Warning
| style="background-color: #ffff66"| float(1) + E_WARNING
| Object of class stdClass could not be converted to string
| E_RECOVERABLE_ERROR
| []
| []
| {}
| {}
Строка 424: Строка 412:
| style="background-color: #ffff66"| int(1) + Warning
| style="background-color: #ffff66"| int(1) + Warning


| style="background-color: #ffff66"| float(1) + Warning
| style="background-color: #ffff66"| float(1) + E_WARNING


| string(5) "value"
| string(5) "value"


| []
| []
| {}
| object(class@anonymous)#1 (0) {}
|-
|-
! (function() { yield 1; yield 2; })()
! (function() { yield 1; yield 2; })()
Строка 438: Строка 426:
| style="background-color: #ffff66"| int(1) + Warning
| style="background-color: #ffff66"| int(1) + Warning


| style="background-color: #ffff66"| float(1) + Warning
| style="background-color: #ffff66"| float(1) + E_WARNING
| Object of class Generator could not be converted to string
| E_RECOVERABLE_ERROR
| []
| []
| {}
| object(Generator)#2 (0) {}
|-
|-
! fopen('file', 'r')
! fopen('file', 'r')
Строка 454: Строка 442:
| string(14) "Resource id #6"
| string(14) "Resource id #6"


| array(1) {
| [resource(6) of type (stream)]
  [0]=>
  resource(6) of type (stream)
}


| object(stdClass)#5 (1) {
| {"scalar":resource(6) of type (stream)}
  ["scalar"]=>
  resource(6) of type (stream)
}


|-
|-
|colspan="25"| * ремарка
|colspan="25"| * [ ] - обозначение массива типа array
|-
|-
|}
|}