3v4l.org

run code in 300+ PHP versions simultaneously
<?php function str_contains_not( $show = '' ) { $url = true; if ( ! str_contains( $show, 'url' ) && ! str_contains( $show, 'directory' ) && ! str_contains( $show, 'home' ) ) { $url = false; } if ( $url ) {} } function str_contains_or( $show = '' ) { if ( str_contains( $show, 'url' ) || str_contains( $show, 'directory' ) || str_contains( $show, 'home' ) ) {} } $its = 1e3; $t = hrtime(true); for ( $i=0;$i++<$its;) $z = str_contains_not( 'blogname' ); echo (hrtime(true)-$t)/1e9,"s\n"; $t = hrtime(true); for ( $i=0;$i++<$its;) $z = str_contains_or( 'blogname' ); echo (hrtime(true)-$t)/1e9,"s\n"; echo "\n=== Warmed up ===\n\n"; $its = 1e5; $t = hrtime(true); for ( $i=0;$i++<$its;) $z = str_contains_not( 'blogname' ); echo 'str_contains_not: ', $a=(hrtime(true)-$t)/1e9,"s\n"; $t = hrtime(true); for ( $i=0;$i++<$its;) $z = str_contains_or( 'blogname' ); echo 'str_contains_or : ', $b=(hrtime(true)-$t)/1e9,"s\n"; echo 'str_contains_or is ', number_format((($a-$b)/$a) * 100, 2 ), "% faster than str_contains_not\n";
Output for git.master, git.master_jit
/bin/php-git-master: error while loading shared libraries: libonig.so.5: cannot open shared object file: No such file or directory
Process exited with code 127.
Output for rfc.property-hooks
6.5037E-5s 5.3471E-5s === Warmed up === str_contains_not: 0.00651828s str_contains_or : 0.00547456s str_contains_or is 16.01% faster than str_contains_not

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
15.38 ms | 406 KiB | 5 Q