3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php foreach(["Hello World!",'','0',1,0,0.0,[],[1,2,3],true,false]as$e) echo var_export($e,1).' : '.var_export((bool)$e,1).'<br>';
Output for 7.0.2 - 7.2.0
'Hello World!' : true<br>'' : false<br>'0' : false<br>1 : true<br>0 : false<br>0.0 : false<br>array ( ) : false<br>array ( 0 => 1, 1 => 2, 2 => 3, ) : true<br>true : true<br>false : false<br>
Output for 5.4.2 - 7.0.1
'Hello World!' : true<br>'' : false<br>'0' : false<br>1 : true<br>0 : false<br>0 : false<br>array ( ) : false<br>array ( 0 => 1, 1 => 2, 2 => 3, ) : true<br>true : true<br>false : false<br>
Output for 5.3.17 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/TC5rL on line 1
Process exited with code 255.