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_COMPAT); // 只转换双引号
Output for 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
=============================== 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/6FYvF on line 15
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:
106.34 ms | 402 KiB | 89 Q