3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace Foo { use function strlen; $string = str_repeat("a", rand(10, 20)); echo "hmm"; echo "strlen is " . strlen($string); echo "strpos is " . \strpos($string, "a"); }
Output for 8.0.11, 8.1.10, 8.2.0
hmmstrlen is 13strpos is 0
Output for 8.0.6, 8.0.17, 8.1.13
hmmstrlen is 17strpos is 0
Output for 8.0.18, 8.0.26, 8.1.2, 8.1.8, 8.1.12
hmmstrlen is 15strpos is 0
Output for 8.0.8, 8.1.11
hmmstrlen is 18strpos is 0
Output for 8.0.2, 8.0.9, 8.0.14, 8.1.3, 8.1.9
hmmstrlen is 20strpos is 0
Output for 8.0.13, 8.0.22, 8.0.24, 8.1.0, 8.1.7
hmmstrlen is 14strpos is 0
Output for 8.0.3, 8.0.25, 8.1.6
hmmstrlen is 16strpos is 0
Output for 8.0.5, 8.0.15, 8.0.20, 8.1.1, 8.1.5
hmmstrlen is 12strpos is 0
Output for 8.0.21, 8.1.4
hmmstrlen is 10strpos is 0
Output for 8.0.10, 8.0.12, 8.0.23
hmmstrlen is 19strpos is 0
Output for 8.0.1, 8.0.7, 8.0.16, 8.0.19
hmmstrlen is 11strpos is 0

preferences:
50.42 ms | 648 KiB | 4 Q