3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = array("hello", "what", "sorry", "Technology"); echo "=============================== hello"; echo "\n\n"; var_dump($str); echo "\n\n=============================== "; echo "=============================== ".print($str[0])."\n"; echo "\n\n123"; print_r($str); // print_r(count(null)); $str = null; echo htmlspecialchars($str, ENT_QUOTES); // 转换双引号和单引号
Output for 8.1.0 - 8.1.33, 8.2.0 - 8.2.29, 8.3.0 - 8.3.28, 8.4.1 - 8.4.14, 8.5.0
=============================== hello array(4) { [0]=> string(5) "hello" [1]=> string(4) "what" [2]=> string(5) "sorry" [3]=> string(10) "Technology" } =============================== hello =============================== 1 123Array ( [0] => hello [1] => what [2] => sorry [3] => Technology ) Deprecated: htmlspecialchars(): Passing null to parameter #1 ($string) of type string is deprecated in /in/ZccVZ on line 15
Output for 8.4.15
/bin/php-8.4.15: /usr/lib/libm.so.6: version `GLIBC_2.38' not found (required by /bin/php-8.4.15) /bin/php-8.4.15: /usr/lib/libm.so.6: version `GLIBC_2.35' not found (required by /bin/php-8.4.15) /bin/php-8.4.15: /usr/lib/libc.so.6: version `GLIBC_2.34' not found (required by /bin/php-8.4.15) /bin/php-8.4.15: /usr/lib/libc.so.6: version `GLIBC_2.38' not found (required by /bin/php-8.4.15)
Process exited with code 1.
Output for 8.0.1 - 8.0.30
=============================== hello array(4) { [0]=> string(5) "hello" [1]=> string(4) "what" [2]=> string(5) "sorry" [3]=> string(10) "Technology" } =============================== hello =============================== 1 123Array ( [0] => hello [1] => what [2] => sorry [3] => Technology )

preferences:
51.14 ms | 410 KiB | 5 Q