3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $vs = array(false, true, 1, 0, 1.1, '', 1E52, new stdclass, array(), fopen('php://output', 'r'), null); foreach($vs as $v) var_dump($v, strlen($v));
Output for 5.3.0 - 7.1.0
bool(false) int(0) bool(true) int(1) int(1) int(1) int(0) int(1) float(1.1) int(3) string(0) "" int(0) float(1.0E+52) int(7) Warning: strlen() expects parameter 1 to be string, object given in /in/lOatl on line 4 object(stdClass)#1 (0) { } NULL Warning: strlen() expects parameter 1 to be string, array given in /in/lOatl on line 4 array(0) { } NULL Warning: strlen() expects parameter 1 to be string, resource given in /in/lOatl on line 4 resource(5) of type (stream) NULL NULL int(0)
Output for 5.2.2 - 5.2.17
bool(false) int(0) bool(true) int(1) int(1) int(1) int(0) int(1) float(1.1) int(3) string(0) "" int(0) float(1.0E+52) int(7) Catchable fatal error: Object of class stdClass could not be converted to string in /in/lOatl on line 4
Process exited with code 255.
Output for 5.2.0 - 5.2.1
bool(false) int(0) bool(true) int(1) int(1) int(1) int(0) int(1) float(1.1) int(3) string(0) "" int(0) float(1.0E+52) int(5) Catchable fatal error: Object of class stdClass could not be converted to string in /in/lOatl on line 4
Process exited with code 255.
Output for 5.0.0 - 5.1.6
bool(false) int(0) bool(true) int(1) int(1) int(1) int(0) int(1) float(1.1) int(3) string(0) "" int(0) float(1.0E+52) int(5) Notice: Object of class stdClass to string conversion in /in/lOatl on line 4 object(stdClass)#1 (0) { } int(6) Notice: Array to string conversion in /in/lOatl on line 4 array(0) { } int(5) resource(2) of type (stream) int(14) NULL int(0)
Output for 4.3.3 - 4.4.9
bool(false) int(0) bool(true) int(1) int(1) int(1) int(0) int(1) float(1.1) int(3) string(0) "" int(0) float(1.0E+52) int(5) Notice: Object to string conversion in /in/lOatl on line 4 object(stdClass)(0) { } int(6) Notice: Array to string conversion in /in/lOatl on line 4 array(0) { } int(5) resource(1) of type (stream) int(14) NULL int(0)
Output for 4.3.0 - 4.3.2
bool(false) int(0) bool(true) int(1) int(1) int(1) int(0) int(1) float(1.1) int(3) string(0) "" int(0) float(1.E+52) int(5) Notice: Object to string conversion in /in/lOatl on line 4 object(stdClass)(0) { } int(6) Notice: Array to string conversion in /in/lOatl on line 4 array(0) { } int(5) resource(1) of type (stream) int(14) NULL int(0)