3v4l.org

run code in 300+ PHP versions simultaneously
<?php $doc = new DOMDocument( '1.0', 'UTF-8' ); $doc->loadHTML( '<?xml encoding="utf-8" ?><p><p><p><p><p>five<p><p><p><p><p>ten' ); $body = $doc->documentElement->childNodes[0]; $start = hrtime( true ); for ( $i = 0; $i < 1_000_000; $i++ ) $dummy = $body->childNodes->item( 4 ); $stop = hrtime( true ); $seconds = ( $stop - $start ) / 1_000_000_000; echo "$seconds s" . PHP_EOL; $start = hrtime( true ); for ( $i = 0; $i < 1_000_000; $i++ ) $dummy = $body->childNodes[4]; $stop = hrtime( true ); $seconds = ( $stop - $start ) / 1_000_000_000; echo "$seconds s" . PHP_EOL;
Output for 8.5.0
0.104341128 s 0.063088106 s
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.4.14
0.104781944 s 0.061625729 s
Output for 8.4.13
0.076733775 s 0.053031696 s
Output for 8.4.12
0.052946751 s 0.04925542 s
Output for 8.4.11
0.058569164 s 0.048908809 s
Output for 8.4.10
0.060882548 s 0.057211884 s
Output for 8.4.9
0.053506124 s 0.049112585 s
Output for 8.4.8
0.066553074 s 0.049723218 s
Output for 8.4.7
0.058155544 s 0.049827562 s
Output for 8.4.6
0.053007036 s 0.050521466 s
Output for 8.4.5
0.054446413 s 0.050974343 s
Output for 8.4.4
0.060651154 s 0.050223628 s
Output for 8.4.3
0.054248515 s 0.050196359 s
Output for 8.4.2
0.054439614 s 0.052251883 s
Output for 8.4.1
0.055978033 s 0.05374729 s
Output for 8.3.28
/bin/php-8.3.28: /usr/lib/libm.so.6: version `GLIBC_2.38' not found (required by /bin/php-8.3.28) /bin/php-8.3.28: /usr/lib/libm.so.6: version `GLIBC_2.35' not found (required by /bin/php-8.3.28) /bin/php-8.3.28: /usr/lib/libc.so.6: version `GLIBC_2.34' not found (required by /bin/php-8.3.28) /bin/php-8.3.28: /usr/lib/libc.so.6: version `GLIBC_2.38' not found (required by /bin/php-8.3.28)
Process exited with code 1.
Output for 8.3.27
0.107814449 s 0.061554179 s
Output for 8.3.26
0.051492424 s 0.047516316 s
Output for 8.3.25
0.054184286 s 0.049382984 s
Output for 8.3.24
0.06952057 s 0.048044185 s
Output for 8.3.23
0.063154588 s 0.05085935 s
Output for 8.3.22
0.062615259 s 0.048791313 s
Output for 8.3.21
0.051650717 s 0.049356267 s
Output for 8.3.20
0.055895083 s 0.049199107 s
Output for 8.3.19
0.050184848 s 0.04774197 s
Output for 8.3.18
0.050434327 s 0.052448029 s
Output for 8.3.17
0.05123165 s 0.048429353 s
Output for 8.3.16
0.05019332 s 0.048021607 s
Output for 8.3.15
0.050491218 s 0.053784539 s
Output for 8.3.14
0.04890726 s 0.04641381 s
Output for 8.3.13
0.049867241 s 0.046274612 s
Output for 8.3.12
0.052316963 s 0.046625198 s
Output for 8.3.11
0.047897047 s 0.045675196 s
Output for 8.3.10
0.047808358 s 0.045297479 s
Output for 8.3.9
0.047851899 s 0.044956722 s
Output for 8.3.8
0.047315223 s 0.047781988 s
Output for 8.3.7
0.047299874 s 0.04640112 s
Output for 8.3.6
0.053571542 s 0.047623319 s
Output for 8.3.5
0.047240722 s 0.045182831 s
Output for 8.3.4
0.057691527 s 0.047048205 s
Output for 8.3.3
0.049628403 s 0.050303329 s
Output for 8.3.2
0.060942301 s 0.045477928 s
Output for 8.3.1
0.057657367 s 0.046721028 s
Output for 8.3.0
0.049552254 s 0.050764564 s
Output for 8.2.29
0.05229227 s 0.047343303 s
Output for 8.2.28
0.050667355 s 0.046580068 s
Output for 8.2.27
0.050511997 s 0.042507033 s
Output for 8.2.26
0.055164899 s 0.044169828 s
Output for 8.2.25
0.050542976 s 0.043294956 s
Output for 8.2.24
0.050305429 s 0.043196357 s
Output for 8.2.23
0.048878901 s 0.043351995 s
Output for 8.2.22
0.050435037 s 0.042647981 s
Output for 8.2.21
0.050395378 s 0.042894128 s
Output for 8.2.20
0.051869346 s 0.052969306 s
Output for 8.2.19
0.050220949 s 0.042347872 s
Output for 8.2.18
0.050187199 s 0.043325216 s
Output for 8.2.17
0.067683435 s 0.043410865 s
Output for 8.2.16
0.064394242 s 0.044847473 s
Output for 8.2.15
0.050672405 s 0.043204276 s
Output for 8.2.14
0.051532158 s 0.043783521 s
Output for 8.2.13
0.056511258 s 0.044421367 s
Output for 8.2.12
0.051095573 s 0.043790912 s
Output for 8.2.11
0.072111389 s 0.044710205 s
Output for 8.2.10
0.049824873 s 0.043191587 s
Output for 8.2.9
0.060164147 s 0.043150667 s
Output for 8.2.8
0.058192854 s 0.049266767 s
Output for 8.2.7
0.069185883 s 0.098650172 s
Output for 8.2.6
0.064133015 s 0.080395353 s
Output for 8.2.5
0.07458081 s 0.091491523 s
Output for 8.2.4
0.059169215 s 0.093399625 s
Output for 8.2.3
0.062100392 s 0.077525284 s
Output for 8.2.2
0.056028962 s 0.082799352 s
Output for 8.2.1
0.058541992 s 0.088563875 s
Output for 8.2.0
0.057196551 s 0.086359834 s

preferences:
65.69 ms | 510 KiB | 5 Q