3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Benchmark example $string = '1234567890123456789012345678901234567890'; // Measure time for strict comparison $start = microtime(true); for ($i = 0; $i < 1000000; $i++) { if ('' === $string) { // Do something } } $end = microtime(true); $strictComparisonTime = $end - $start; // Measure time for count function $start = microtime(true); for ($i = 0; $i < 1000000; $i++) { if (\strlen($string)) { // Do something } } $end = microtime(true); $countFunctionTime = $end - $start; // Output the results echo "Time taken for strict comparison: " . $strictComparisonTime . " seconds\n"; echo "Time taken for strlen function: " . $countFunctionTime . " seconds\n";
Output for git.master
Time taken for strict comparison: 0.0072870254516602 seconds Time taken for strlen function: 0.009091854095459 seconds
Output for git.master_jit
Time taken for strict comparison: 0.0074210166931152 seconds Time taken for strlen function: 0.0090320110321045 seconds

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:
77.21 ms | 406 KiB | 5 Q