<?php //$host = 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'; $host = 'unix://unixhost'; $start = microtime(true); for ($i=0; $i<=1000; $i++) { substr($host, 0, strlen('unix://')) !== 'unix://'; } echo (microtime(true) - $start) . PHP_EOL; $start = microtime(true); for ($i=0; $i<=1000; $i++) { strpos($host, 'unix://') !== 0; } echo (microtime(true) - $start) . PHP_EOL; $start = microtime(true); for ($i=0; $i<=1000; $i++) { preg_match('~^unix://~', $host); } echo (microtime(true) - $start) . PHP_EOL;
You have javascript disabled. You will not be able to edit any code.
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).