3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $a = 0001111222 ; var_dump($a); var_dump(is_numeric($a)); //true var_dump(ctype_digit($a)); //true var_dump(ctype_digit(77)); echo '分 '; $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)); $c=null; var_dump(isset($c)); var_dump(is_null ($c)); echo "<br/>数值强制转换:"; $string="2a"; $string1=intval($string); echo '$string1的值:'.$string1.'$string2的值:';//单引号不会输出变量,将原样输出 $string2=(int)($string); echo $string2 ; var_dump(json_encode(array(1,2,3,'4'),1));
Output for 5.3.0 - 7.1.0
int(299666) bool(true) bool(true) bool(false) 分 float(0.1) bool(true) bool(false) int(-1) bool(true) bool(false) Notice: Use of undefined constant a - assumed 'a' in /in/JWVTU on line 19 string(1) "a" bool(false) bool(false) float(4) bool(false) float(945) int(944) float(945) int(945) bool(false) bool(true) <br/>数值强制转换:$string1的值:2$string2的值:2string(11) "[1,2,3,"4"]"
Output for 5.2.0 - 5.2.17
int(299666) bool(true) bool(true) bool(false) 分 float(0.1) bool(true) bool(false) int(-1) bool(true) bool(false) Notice: Use of undefined constant a - assumed 'a' in /in/JWVTU on line 19 string(1) "a" bool(false) bool(false) float(4) bool(false) float(945) int(944) float(945) int(945) bool(false) bool(true) <br/>数值强制转换:$string1的值:2$string2的值:2 Warning: json_encode() expects exactly 1 parameter, 2 given in /in/JWVTU on line 42 NULL
Output for 5.1.0 - 5.1.6
int(299666) bool(true) bool(true) bool(false) 分 float(0.1) bool(true) bool(false) int(-1) bool(true) bool(false) Notice: Use of undefined constant a - assumed 'a' in /in/JWVTU on line 19 string(1) "a" bool(false) bool(false) float(4) bool(false) float(945) int(944) float(945) int(945) bool(false) bool(true) <br/>数值强制转换:$string1的值:2$string2的值:2 Fatal error: Call to undefined function json_encode() in /in/JWVTU on line 42
Process exited with code 255.
Output for 5.0.3 - 5.0.5
int(299666) bool(true) bool(true) bool(false) 分 NULL NULL NULL NULL NULL NULL Notice: Use of undefined constant a - assumed 'a' in /in/JWVTU on line 19 string(1) "a" bool(false) bool(false) float(4) bool(false) float(945) int(944) float(945) int(945) bool(false) bool(true) <br/>数值强制转换:$string1的值:2$string2的值:2 Fatal error: Call to undefined function json_encode() in /in/JWVTU on line 42
Process exited with code 255.
Output for 4.3.0 - 4.3.9, 5.0.0 - 5.0.2
int(299666) bool(true)
Process exited with code 139.
Output for 4.4.5 - 4.4.9
int(299666) bool(true) bool(true) bool(false) 分 float(0.1) bool(true) bool(false) int(-1) bool(true) bool(false) Notice: Use of undefined constant a - assumed 'a' in /in/JWVTU on line 19 string(1) "a" bool(false) bool(false) float(4) bool(false) float(945) int(944) float(945) int(945) bool(false) bool(true) <br/>数值强制转换:$string1的值:2$string2的值:2 Fatal error: Call to undefined function: json_encode() in /in/JWVTU on line 42
Process exited with code 255.
Output for 4.4.1 - 4.4.4
int(299666) bool(true) bool(true) bool(false) 分 float(0.1) bool(true) bool(false) int(-1) bool(true) bool(false) Notice: Use of undefined constant a - assumed 'a' in /in/JWVTU on line 19 string(1) "a" bool(false) bool(false) float(4) bool(false) float(945) int(944) float(945) int(945) bool(false) bool(true) <br/>数值强制转换:$string1的值:2$string2的值:2 Fatal error: Call to undefined function: json_encode() in /in/JWVTU on line 42
Process exited with code 255.
Output for 4.3.10 - 4.4.0
int(299666) bool(true) bool(true) bool(false) 分 NULL NULL NULL NULL NULL NULL Notice: Use of undefined constant a - assumed 'a' in /in/JWVTU on line 19 string(1) "a" bool(false) bool(false) float(4) bool(false) float(945) int(944) float(945) int(945) bool(false) bool(true) <br/>数值强制转换:$string1的值:2$string2的值:2 Fatal error: Call to undefined function: json_encode() in /in/JWVTU on line 42
Process exited with code 255.