3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = 0001111222 ; var_dump($a); var_dump(is_numeric($a)); //true var_dump(ctype_digit($a)); //true $a = 0.1 ; var_dump($a); var_dump(is_numeric($a)); //true var_dump(ctype_digit($a)); //false $a = -1 ; var_dump($a); var_dump(is_numeric($a)); //true var_dump(ctype_digit($a)); //false $a = a ; var_dump($a); var_dump(is_numeric($a)); //false var_dump(ctype_digit($a)); //false var_dump(sqrt(16)); var_dump(is_int(sqrt(16))); $a = 9.45*100; var_dump($a); var_dump(intval($a)); $a = 945*1.00; var_dump($a); var_dump(intval($a)); echo "<br/>数值强制转换:"; $string="2a"; $string1=intval($string); echo '$string1的值:'.$string1.'$string2的值:';//单引号不会输出变量,将原样输出 $string2=(int)($string); echo $string2 ;
Output for git.master, git.master_jit, rfc.property-hooks
int(299666) bool(true) Deprecated: ctype_digit(): Argument of type int will be interpreted as string in the future in /in/qEaq6 on line 6 bool(true) float(0.1) bool(true) Deprecated: ctype_digit(): Argument of type float will be interpreted as string in the future in /in/qEaq6 on line 10 bool(false) int(-1) bool(true) Deprecated: ctype_digit(): Argument of type int will be interpreted as string in the future in /in/qEaq6 on line 15 bool(false) Fatal error: Uncaught Error: Undefined constant "a" in /in/qEaq6:17 Stack trace: #0 {main} thrown in /in/qEaq6 on line 17
Process exited with code 255.

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:
36.25 ms | 401 KiB | 8 Q