3v4l.org

run code in 300+ PHP versions simultaneously
<?php $vals = array('3 fish', ' +01.0001 ', ' +01.0000000 ', true, false, null, 1e8); foreach ($vals as $val) { printf("is %s an int? %s == %s --> %s\n", var_export($val, true), var_export((string)(int)$val, true), var_export(trim($val), true), var_export((string)(int)$val == trim($val), true) ); }
Output for git.master, git.master_jit, rfc.property-hooks
is '3 fish' an int? '3' == '3 fish' --> false is ' +01.0001 ' an int? '1' == '+01.0001' --> false is ' +01.0000000 ' an int? '1' == '+01.0000000' --> true is true an int? '1' == '1' --> true is false an int? '0' == '' --> false Deprecated: trim(): Passing null to parameter #1 ($string) of type string is deprecated in /in/Gog9g on line 8 Deprecated: trim(): Passing null to parameter #1 ($string) of type string is deprecated in /in/Gog9g on line 9 is NULL an int? '0' == '' --> false is 100000000.0 an int? '100000000' == '100000000' --> true

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
44.99 ms | 402 KiB | 8 Q