3v4l.org

run code in 300+ PHP versions simultaneously
<?php $test = 'String_With_Underscores'; $start = microtime(true); for ($i = 0; $i < 100000; $i++) { $result = implode('', array_map('ucfirst', explode('_', strtolower($test)))); } echo 'Time taken: ' . (microtime(true) - $start) . 's';
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 24
Branch analysis from position: 24
2 jumps found. (Code = 44) Position 1 = 26, Position 2 = 7
Branch analysis from position: 26
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
2 jumps found. (Code = 44) Position 1 = 26, Position 2 = 7
Branch analysis from position: 26
Branch analysis from position: 7
filename:       /in/kDfKb
function name:  (null)
number of ops:  34
compiled vars:  !0 = $test, !1 = $start, !2 = $i, !3 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'String_With_Underscores'
    3     1        INIT_FCALL                                               'microtime'
          2        SEND_VAL                                                 <true>
          3        DO_ICALL                                         $5      
          4        ASSIGN                                                   !1, $5
    4     5        ASSIGN                                                   !2, 0
          6      > JMP                                                      ->24
    5     7    >   INIT_FCALL                                               'implode'
          8        SEND_VAL                                                 ''
          9        INIT_FCALL                                               'array_map'
         10        SEND_VAL                                                 'ucfirst'
         11        INIT_FCALL                                               'explode'
         12        SEND_VAL                                                 '_'
         13        INIT_FCALL                                               'strtolower'
         14        SEND_VAR                                                 !0
         15        DO_ICALL                                         $8      
         16        SEND_VAR                                                 $8
         17        DO_ICALL                                         $9      
         18        SEND_VAR                                                 $9
         19        DO_ICALL                                         $10     
         20        SEND_VAR                                                 $10
         21        DO_ICALL                                         $11     
         22        ASSIGN                                                   !3, $11
    4    23        PRE_INC                                                  !2
         24    >   IS_SMALLER                                               !2, 100000
         25      > JMPNZ                                                    ~14, ->7
    7    26    >   INIT_FCALL                                               'microtime'
         27        SEND_VAL                                                 <true>
         28        DO_ICALL                                         $15     
         29        SUB                                              ~16     $15, !1
         30        CONCAT                                           ~17     'Time+taken%3A+', ~16
         31        CONCAT                                           ~18     ~17, 's'
         32        ECHO                                                     ~18
         33      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.84 ms | 1396 KiB | 23 Q