3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace std { function array_push(array &$array, mixed ...$values): int { foreach ($values as $value) $array[] = $value; return \count($array); } } namespace { $preflight = microtime(true); $foo = ['bar', 123, 'baz', true]; $start = microtime(true); var_dump(array_push($foo, 123, 'bzzz'), $foo); $end = microtime(true); printf("%0.6fs\n", $end - $start); $foo = ['bar', 123, 'baz', true]; $start = microtime(true); var_dump(std\array_push($foo, 123, 'bzzz'), $foo); $end = microtime(true); printf("%0.6fs\n", $end - $start); }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/kj3fj
function name:  (null)
number of ops:  51
compiled vars:  !0 = $preflight, !1 = $foo, !2 = $start, !3 = $end
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   INIT_FCALL                                               'microtime'
          1        SEND_VAL                                                 <true>
          2        DO_ICALL                                         $4      
          3        ASSIGN                                                   !0, $4
   11     4        ASSIGN                                                   !1, <array>
   12     5        INIT_FCALL                                               'microtime'
          6        SEND_VAL                                                 <true>
          7        DO_ICALL                                         $7      
          8        ASSIGN                                                   !2, $7
   13     9        INIT_FCALL                                               'var_dump'
         10        INIT_FCALL                                               'array_push'
         11        SEND_REF                                                 !1
         12        SEND_VAL                                                 123
         13        SEND_VAL                                                 'bzzz'
         14        DO_ICALL                                         $9      
         15        SEND_VAR                                                 $9
         16        SEND_VAR                                                 !1
         17        DO_ICALL                                                 
   14    18        INIT_FCALL                                               'microtime'
         19        SEND_VAL                                                 <true>
         20        DO_ICALL                                         $11     
         21        ASSIGN                                                   !3, $11
   15    22        INIT_FCALL                                               'printf'
         23        SEND_VAL                                                 '%250.6fs%0A'
         24        SUB                                              ~13     !3, !2
         25        SEND_VAL                                                 ~13
         26        DO_ICALL                                                 
   16    27        ASSIGN                                                   !1, <array>
   17    28        INIT_FCALL                                               'microtime'
         29        SEND_VAL                                                 <true>
         30        DO_ICALL                                         $16     
         31        ASSIGN                                                   !2, $16
   18    32        INIT_FCALL                                               'var_dump'
         33        INIT_FCALL                                               'std%5Carray_push'
         34        SEND_REF                                                 !1
         35        SEND_VAL                                                 123
         36        SEND_VAL                                                 'bzzz'
         37        DO_FCALL                                      0  $18     
         38        SEND_VAR                                                 $18
         39        SEND_VAR                                                 !1
         40        DO_ICALL                                                 
   19    41        INIT_FCALL                                               'microtime'
         42        SEND_VAL                                                 <true>
         43        DO_ICALL                                         $20     
         44        ASSIGN                                                   !3, $20
   20    45        INIT_FCALL                                               'printf'
         46        SEND_VAL                                                 '%250.6fs%0A'
         47        SUB                                              ~22     !3, !2
         48        SEND_VAL                                                 ~22
         49        DO_ICALL                                                 
   21    50      > RETURN                                                   1

Function std%5Carray_push:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 7
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 7
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
filename:       /in/kj3fj
function name:  std\array_push
number of ops:  13
compiled vars:  !0 = $array, !1 = $values, !2 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
          1        RECV_VARIADIC                                    !1      
    5     2      > FE_RESET_R                                       $3      !1, ->7
          3    > > FE_FETCH_R                                               $3, !2, ->7
          4    >   ASSIGN_DIM                                               !0
          5        OP_DATA                                                  !2
          6      > JMP                                                      ->3
          7    >   FE_FREE                                                  $3
    6     8        COUNT                                            ~5      !0
          9        VERIFY_RETURN_TYPE                                       ~5
         10      > RETURN                                                   ~5
    7    11*       VERIFY_RETURN_TYPE                                       
         12*     > RETURN                                                   null

End of function std%5Carray_push

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
134.23 ms | 1407 KiB | 22 Q