3v4l.org

run code in 300+ PHP versions simultaneously
<?php ini_set("display_errors","On"); error_reporting(E_ALL); function without($var){ echo "Certain death\n"; $var.='die fucker DIE! ajajajajajajjjkajklsdjklasjdklasd'; echo memory_get_usage(), PHP_EOL; } function with(&$var){ echo "Alive\n"; echo memory_get_usage(), PHP_EOL; } $str = str_repeat('foo', 10000000); echo memory_get_usage(), PHP_EOL; echo "END\n"; with($str); without($str);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/TS415
function name:  (null)
number of ops:  24
compiled vars:  !0 = $str
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'ini_set'
          1        SEND_VAL                                                 'display_errors'
          2        SEND_VAL                                                 'On'
          3        DO_ICALL                                                 
    4     4        INIT_FCALL                                               'error_reporting'
          5        SEND_VAL                                                 32767
          6        DO_ICALL                                                 
   18     7        INIT_FCALL                                               'str_repeat'
          8        SEND_VAL                                                 'foo'
          9        SEND_VAL                                                 10000000
         10        DO_ICALL                                         $3      
         11        ASSIGN                                                   !0, $3
   19    12        INIT_FCALL                                               'memory_get_usage'
         13        DO_ICALL                                         $5      
         14        ECHO                                                     $5
         15        ECHO                                                     '%0A'
   21    16        ECHO                                                     'END%0A'
   22    17        INIT_FCALL                                               'with'
         18        SEND_REF                                                 !0
         19        DO_FCALL                                      0          
   23    20        INIT_FCALL                                               'without'
         21        SEND_VAR                                                 !0
         22        DO_FCALL                                      0          
         23      > RETURN                                                   1

Function without:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/TS415
function name:  without
number of ops:  8
compiled vars:  !0 = $var
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
    7     1        ECHO                                                     'Certain+death%0A'
    8     2        ASSIGN_OP                                     8          !0, 'die+fucker+DIE%21+ajajajajajajjjkajklsdjklasjdklasd'
    9     3        INIT_FCALL                                               'memory_get_usage'
          4        DO_ICALL                                         $2      
          5        ECHO                                                     $2
          6        ECHO                                                     '%0A'
   10     7      > RETURN                                                   null

End of function without

Function with:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/TS415
function name:  with
number of ops:  7
compiled vars:  !0 = $var
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   RECV                                             !0      
   13     1        ECHO                                                     'Alive%0A'
   14     2        INIT_FCALL                                               'memory_get_usage'
          3        DO_ICALL                                         $1      
          4        ECHO                                                     $1
          5        ECHO                                                     '%0A'
   15     6      > RETURN                                                   null

End of function with

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.99 ms | 1394 KiB | 23 Q