3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace std { function array_pop(array &$array): mixed { foreach ($array as $key => $value) {} unset($array[$key]); return $value; } } namespace { $preflight = microtime(true); $foo = ['bar', 123, 'baz', true]; $start = microtime(true); var_dump(array_pop($foo), $foo); $end = microtime(true); printf("%0.6fs\n", $end - $start); $foo = ['bar', 123, 'baz', true]; $start = microtime(true); var_dump(std\array_pop($foo), $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/tqq3U
function name:  (null)
number of ops:  47
compiled vars:  !0 = $preflight, !1 = $foo, !2 = $start, !3 = $end
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   INIT_FCALL                                               'microtime'
          1        SEND_VAL                                                 <true>
          2        DO_ICALL                                         $4      
          3        ASSIGN                                                   !0, $4
   12     4        ASSIGN                                                   !1, <array>
   13     5        INIT_FCALL                                               'microtime'
          6        SEND_VAL                                                 <true>
          7        DO_ICALL                                         $7      
          8        ASSIGN                                                   !2, $7
   14     9        INIT_FCALL                                               'var_dump'
         10        INIT_FCALL                                               'array_pop'
         11        SEND_REF                                                 !1
         12        DO_ICALL                                         $9      
         13        SEND_VAR                                                 $9
         14        SEND_VAR                                                 !1
         15        DO_ICALL                                                 
   15    16        INIT_FCALL                                               'microtime'
         17        SEND_VAL                                                 <true>
         18        DO_ICALL                                         $11     
         19        ASSIGN                                                   !3, $11
   16    20        INIT_FCALL                                               'printf'
         21        SEND_VAL                                                 '%250.6fs%0A'
         22        SUB                                              ~13     !3, !2
         23        SEND_VAL                                                 ~13
         24        DO_ICALL                                                 
   17    25        ASSIGN                                                   !1, <array>
   18    26        INIT_FCALL                                               'microtime'
         27        SEND_VAL                                                 <true>
         28        DO_ICALL                                         $16     
         29        ASSIGN                                                   !2, $16
   19    30        INIT_FCALL                                               'var_dump'
         31        INIT_FCALL                                               'std%5Carray_pop'
         32        SEND_REF                                                 !1
         33        DO_FCALL                                      0  $18     
         34        SEND_VAR                                                 $18
         35        SEND_VAR                                                 !1
         36        DO_ICALL                                                 
   20    37        INIT_FCALL                                               'microtime'
         38        SEND_VAL                                                 <true>
         39        DO_ICALL                                         $20     
         40        ASSIGN                                                   !3, $20
   21    41        INIT_FCALL                                               'printf'
         42        SEND_VAL                                                 '%250.6fs%0A'
         43        SUB                                              ~22     !3, !2
         44        SEND_VAL                                                 ~22
         45        DO_ICALL                                                 
   22    46      > RETURN                                                   1

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

End of function std%5Carray_pop

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
127.44 ms | 1407 KiB | 22 Q