3v4l.org

run code in 300+ PHP versions simultaneously
<?php $menu_slug = "pens-and-pencils"; $menu_title = "Pens and Pencils"; $tests = 10000; $loop = $tests; $a = hrtime(1); while ($loop > 0 ) { base_convert( substr( md5( $menu_slug . $menu_title ), -4 ), 16, 10 ) * 0.00001; $loop--; } var_dump( hrtime(1) - $a ); $loop = $tests; $a = hrtime(1); while ($loop > 0 ) { substr( base_convert( md5( $menu_slug . $menu_title ), 16, 10 ), -5 ) * 0.00001; $loop--; } var_dump( hrtime(1) - $a );
Output for 8.4.2
int(4993080) int(41462405)
Output for 8.4.1
int(1925870) int(22445379)
Output for 8.3.15
int(4940382) int(35190092)
Output for 8.3.14
int(4839248) int(54906496)
Output for 8.3.13
int(1908021) int(22693511)
Output for 8.3.12
int(1889189) int(22857164)
Output for 8.3.11
int(2038423) int(22706047)
Output for 8.3.10
int(2008259) int(23110591)
Output for 8.3.9
int(2976757) int(22629800)
Output for 8.3.8
int(3295201) int(35084955)
Output for 8.3.7
int(3603700) int(43478773)
Output for 8.3.6
int(5597095) int(58164701)
Output for 8.3.5
int(5541651) int(50143206)
Output for 8.3.4
int(3708309) int(41938217)
Output for 8.3.3
int(3748960) int(42384021)
Output for 8.3.2
int(1906108) int(22474421)
Output for 8.3.1
int(1940634) int(22591196)
Output for 8.3.0
int(1961773) int(25406834)
Output for 8.2.27
int(5875348) int(48815829)
Output for 8.2.26
int(1990078) int(22685466)
Output for 8.2.25
int(1932842) int(23605447)
Output for 8.2.24
int(2027608) int(22961049)
Output for 8.2.23
int(1944422) int(22969936)
Output for 8.2.22
int(2126522) int(22826821)
Output for 8.2.21
int(5142465) int(39723190)
Output for 8.2.20
int(2670491) int(27816113)
Output for 8.2.19
int(3602161) int(42561792)
Output for 8.2.18
int(3666419) int(42433639)
Output for 8.2.17
int(3668894) int(42259645)
Output for 8.2.16
int(4631918) int(42532066)
Output for 8.2.15
int(2051656) int(22751224)
Output for 8.2.14
int(1968192) int(22550223)
Output for 8.2.13
int(2004006) int(22703568)
Output for 8.2.12
int(1992748) int(22452675)
Output for 8.2.11
int(2747231) int(23316861)
Output for 8.2.10
int(2766238) int(24209377)
Output for 8.1.31
int(4011057) int(51796762)
Output for 8.1.30
int(2015702) int(22841386)
Output for 8.1.29
int(2784126) int(27684759)
Output for 8.1.28
int(3906998) int(43226423)
Output for 8.1.27
int(1992503) int(22979219)
Output for 8.1.26
int(2002126) int(23922536)
Output for 8.1.25
int(2221044) int(22584298)
Output for 8.1.24
int(2787526) int(24531815)
Output for 8.1.23
int(2720317) int(23513102)
Output for 8.1.5
int(3272782) int(32500474)
Output for 7.4.29
int(3454585) int(33636073)
Output for 7.3.33
int(3426192) int(32953127)

preferences:
92.74 ms | 469 KiB | 5 Q