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";

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
8.4.20.0160.02917.86
8.4.10.0100.01019.47
8.3.150.0110.03420.84
8.3.140.0040.01818.60
8.3.130.0090.01216.57
8.3.120.0070.01620.94
8.3.110.0000.02120.94
8.3.100.0070.01816.63
8.3.90.0100.01026.77
8.3.80.0000.02518.34
8.3.70.0100.04018.48
8.3.60.0100.02718.55
8.3.50.0000.03716.47
8.3.40.0100.03223.81
8.3.30.0030.03319.04
8.3.20.0000.02024.18
8.3.10.0030.01724.66
8.3.00.0030.01726.16
8.2.270.0140.03017.28
8.2.260.0070.01419.16
8.2.250.0070.02016.56
8.2.240.0060.01517.36
8.2.230.0120.00922.58
8.2.220.0070.01424.06
8.2.210.0000.02026.77
8.2.200.0060.01816.50
8.2.190.0070.04716.58
8.2.180.0140.03118.29
8.2.170.0000.03718.87
8.2.160.0060.03222.96
8.2.150.0070.01325.66
8.2.140.0000.02124.66
8.2.130.0030.01626.16
8.2.120.0120.00920.91
8.2.110.0100.02022.39
8.2.100.0380.01518.44
8.2.90.0250.02118.44
8.2.80.0270.01918.44
8.2.70.0280.02218.44
8.2.60.0340.01418.44
8.2.50.0240.02418.44
8.2.40.0190.02518.44
8.2.30.0260.01718.44
8.2.20.0190.02618.44
8.2.10.0270.01818.44
8.2.00.0240.02118.44
8.1.310.0130.03516.52
8.1.300.0140.01720.24
8.1.290.0070.01730.84
8.1.280.0160.02325.92
8.1.270.0090.01224.66
8.1.260.0070.01326.35
8.1.250.0030.01728.09
8.1.240.0100.03323.98
8.1.230.0250.02118.44
8.1.220.0290.01518.44
8.1.210.0210.02418.44
8.1.200.0350.01918.44
8.1.190.0160.02818.44
8.1.180.0210.02418.44
8.1.170.0250.02018.44
8.1.160.0120.03118.44
8.1.150.0150.02918.44
8.1.140.0150.02818.44
8.1.130.0170.02718.44
8.1.120.0220.02118.44
8.1.110.0190.02618.44
8.1.100.0200.02318.44
8.1.90.0260.02018.44
8.1.80.0220.02318.44
8.1.70.0200.02318.44
8.1.60.0230.02018.44
8.1.50.0160.02318.44
8.1.40.0140.02518.44
8.1.30.0190.02618.44
8.1.20.0240.02118.44
8.1.10.0220.02218.44
8.1.00.0180.02218.44
8.0.300.0120.02618.44
8.0.290.0250.02218.44
8.0.280.0190.02718.44
8.0.270.0190.02718.44
8.0.260.0200.02418.44
8.0.250.0270.01618.44
8.0.240.0210.02218.44
8.0.230.0180.02718.44
8.0.220.0220.02318.44
8.0.210.0220.02518.44
8.0.200.0310.01918.44
8.0.190.0210.02518.44
8.0.180.0220.02618.44
8.0.170.0240.02018.44
8.0.160.0270.01818.44
8.0.150.0130.02518.44
8.0.140.0220.02218.44
8.0.130.0210.01518.44
8.0.120.0180.02518.44
8.0.110.0150.02718.44
8.0.100.0200.02618.44
8.0.90.0290.01618.44
8.0.80.0190.02518.44
8.0.70.0230.02118.44
8.0.60.0260.01718.44
8.0.50.0290.01218.44
8.0.30.0210.02118.44
8.0.20.0210.02418.44
8.0.10.0260.01618.44

preferences:
42.79 ms | 403 KiB | 5 Q