3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { } $objects = array_map(function () { return new Foo; }, range(0, 10000)); var_dump(memory_get_usage());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/0OtiB
function name:  (null)
number of ops:  16
compiled vars:  !0 = $objects
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   INIT_FCALL                                               'array_map'
          1        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2F0OtiB%3A7%240'
          2        SEND_VAL                                                 ~1
          3        INIT_FCALL                                               'range'
          4        SEND_VAL                                                 0
          5        SEND_VAL                                                 10000
          6        DO_ICALL                                         $2      
          7        SEND_VAR                                                 $2
          8        DO_ICALL                                         $3      
          9        ASSIGN                                                   !0, $3
    9    10        INIT_FCALL                                               'var_dump'
         11        INIT_FCALL                                               'memory_get_usage'
         12        DO_ICALL                                         $5      
         13        SEND_VAR                                                 $5
         14        DO_ICALL                                                 
         15      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2F0OtiB%3A7%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/0OtiB
function name:  {closure}
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   NEW                                              $0      'Foo'
          1        DO_FCALL                                      0          
          2      > RETURN                                                   $0
          3*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2F0OtiB%3A7%240

Class Foo: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.61 ms | 1395 KiB | 21 Q