3v4l.org

run code in 300+ PHP versions simultaneously
<?php function test($str) { test2($str); } function test2($str) { test3($str); } function test3($str) { echo "before: ".round(memory_get_usage()/1024/1024, 2)." MB\n"; debug_backtrace(false); echo "after: ".round(memory_get_usage()/1024/1024, 2)." MB\n"; } test(str_repeat('a', 10000000));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cJpmi
function name:  (null)
number of ops:  8
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   INIT_FCALL                                               'test'
          1        INIT_FCALL                                               'str_repeat'
          2        SEND_VAL                                                 'a'
          3        SEND_VAL                                                 10000000
          4        DO_ICALL                                         $0      
          5        SEND_VAR                                                 $0
          6        DO_FCALL                                      0          
          7      > RETURN                                                   1

Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cJpmi
function name:  test
number of ops:  5
compiled vars:  !0 = $str
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    3     1        INIT_FCALL_BY_NAME                                       'test2'
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0          
    4     4      > RETURN                                                   null

End of function test

Function test2:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cJpmi
function name:  test2
number of ops:  5
compiled vars:  !0 = $str
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    6     1        INIT_FCALL_BY_NAME                                       'test3'
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0          
    7     4      > RETURN                                                   null

End of function test2

Function test3:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cJpmi
function name:  test3
number of ops:  27
compiled vars:  !0 = $str
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
    9     1        INIT_FCALL                                               'round'
          2        INIT_FCALL                                               'memory_get_usage'
          3        DO_ICALL                                         $1      
          4        DIV                                              ~2      $1, 1024
          5        DIV                                              ~3      ~2, 1024
          6        SEND_VAL                                                 ~3
          7        SEND_VAL                                                 2
          8        DO_ICALL                                         $4      
          9        CONCAT                                           ~5      'before%3A+', $4
         10        CONCAT                                           ~6      ~5, '+MB%0A'
         11        ECHO                                                     ~6
   10    12        INIT_FCALL                                               'debug_backtrace'
         13        SEND_VAL                                                 <false>
         14        DO_ICALL                                                 
   11    15        INIT_FCALL                                               'round'
         16        INIT_FCALL                                               'memory_get_usage'
         17        DO_ICALL                                         $8      
         18        DIV                                              ~9      $8, 1024
         19        DIV                                              ~10     ~9, 1024
         20        SEND_VAL                                                 ~10
         21        SEND_VAL                                                 2
         22        DO_ICALL                                         $11     
         23        CONCAT                                           ~12     'after%3A+', $11
         24        CONCAT                                           ~13     ~12, '+MB%0A'
         25        ECHO                                                     ~13
   12    26      > RETURN                                                   null

End of function test3

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.08 ms | 1403 KiB | 22 Q