3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = str_repeat('1', 1024 * 1024); var_dump(memory_get_usage()); $str2 = (string)$str; var_dump(memory_get_usage());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/jnCog
function name:  (null)
number of ops:  18
compiled vars:  !0 = $str, !1 = $str2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'str_repeat'
          1        SEND_VAL                                                 '1'
          2        SEND_VAL                                                 1048576
          3        DO_ICALL                                         $2      
          4        ASSIGN                                                   !0, $2
    4     5        INIT_FCALL                                               'var_dump'
          6        INIT_FCALL                                               'memory_get_usage'
          7        DO_ICALL                                         $4      
          8        SEND_VAR                                                 $4
          9        DO_ICALL                                                 
    6    10        CAST                                          6  ~6      !0
         11        ASSIGN                                                   !1, ~6
    7    12        INIT_FCALL                                               'var_dump'
         13        INIT_FCALL                                               'memory_get_usage'
         14        DO_ICALL                                         $8      
         15        SEND_VAR                                                 $8
         16        DO_ICALL                                                 
         17      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.76 ms | 1394 KiB | 19 Q