3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Tester { public function doNothing() { $res = array(); for ( $i = 0; $i < 10000; $i++) { $res[$i] = new StdClass; } } } $t = new Tester(); echo "Before: ".memory_get_usage()."\n"; $t->doNothing(); echo "After: ".memory_get_usage()."\n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ANaau
function name:  (null)
number of ops:  16
compiled vars:  !0 = $t
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   NEW                                              $1      'Tester'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   12     3        INIT_FCALL                                               'memory_get_usage'
          4        DO_ICALL                                         $4      
          5        CONCAT                                           ~5      'Before%3A+', $4
          6        CONCAT                                           ~6      ~5, '%0A'
          7        ECHO                                                     ~6
   13     8        INIT_METHOD_CALL                                         !0, 'doNothing'
          9        DO_FCALL                                      0          
   14    10        INIT_FCALL                                               'memory_get_usage'
         11        DO_ICALL                                         $8      
         12        CONCAT                                           ~9      'After%3A+', $8
         13        CONCAT                                           ~10     ~9, '%0A'
         14        ECHO                                                     ~10
         15      > RETURN                                                   1

Class Tester:
Function donothing:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
2 jumps found. (Code = 44) Position 1 = 10, Position 2 = 3
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 3
2 jumps found. (Code = 44) Position 1 = 10, Position 2 = 3
Branch analysis from position: 10
Branch analysis from position: 3
filename:       /in/ANaau
function name:  doNothing
number of ops:  11
compiled vars:  !0 = $res, !1 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ASSIGN                                                   !0, <array>
    5     1        ASSIGN                                                   !1, 0
          2      > JMP                                                      ->8
    6     3    >   NEW                                              $5      'StdClass'
          4        DO_FCALL                                      0          
          5        ASSIGN_DIM                                               !0, !1
          6        OP_DATA                                                  $5
    5     7        PRE_INC                                                  !1
          8    >   IS_SMALLER                                               !1, 10000
          9      > JMPNZ                                                    ~8, ->3
    8    10    > > RETURN                                                   null

End of function donothing

End of class Tester.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.19 ms | 1396 KiB | 15 Q