3v4l.org

run code in 300+ PHP versions simultaneously
<?php $mem_start = memory_get_usage(true); echo 'start: ' . $mem_start . PHP_EOL; class Foo { public static function bar() { return new Foo; } } $max_iterations = 10000; for ($i = 1; $i <= $max_iterations; $i++) { //DateTime::createFromFormat('M/D/Y H:i:s', '2013-11-12 20:00:00'); Foo::bar(); if (($i % 1000) == 0) { echo $i . '.: ' . memory_get_usage(true) . PHP_EOL; } } $mem_end = memory_get_usage(true); echo 'end: ' . $mem_end . PHP_EOL; echo 'diff end-start: ' . ($mem_end - $mem_start) . PHP_EOL;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 23
Branch analysis from position: 23
2 jumps found. (Code = 44) Position 1 = 25, Position 2 = 10
Branch analysis from position: 25
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
2 jumps found. (Code = 43) Position 1 = 15, Position 2 = 22
Branch analysis from position: 15
2 jumps found. (Code = 44) Position 1 = 25, Position 2 = 10
Branch analysis from position: 25
Branch analysis from position: 10
Branch analysis from position: 22
filename:       /in/qP0UE
function name:  (null)
number of ops:  37
compiled vars:  !0 = $mem_start, !1 = $max_iterations, !2 = $i, !3 = $mem_end
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'memory_get_usage'
          1        SEND_VAL                                                 <true>
          2        DO_ICALL                                         $4      
          3        ASSIGN                                                   !0, $4
    3     4        CONCAT                                           ~6      'start%3A+', !0
          5        CONCAT                                           ~7      ~6, '%0A'
          6        ECHO                                                     ~7
   11     7        ASSIGN                                                   !1, 10000
   12     8        ASSIGN                                                   !2, 1
          9      > JMP                                                      ->23
   14    10    >   INIT_STATIC_METHOD_CALL                                  'Foo', 'bar'
         11        DO_FCALL                                      0          
   15    12        MOD                                              ~11     !2, 1000
         13        IS_EQUAL                                                 ~11, 0
         14      > JMPZ                                                     ~12, ->22
   16    15    >   CONCAT                                           ~13     !2, '.%3A+'
         16        INIT_FCALL                                               'memory_get_usage'
         17        SEND_VAL                                                 <true>
         18        DO_ICALL                                         $14     
         19        CONCAT                                           ~15     ~13, $14
         20        CONCAT                                           ~16     ~15, '%0A'
         21        ECHO                                                     ~16
   12    22    >   PRE_INC                                                  !2
         23    >   IS_SMALLER_OR_EQUAL                                      !2, !1
         24      > JMPNZ                                                    ~18, ->10
   19    25    >   INIT_FCALL                                               'memory_get_usage'
         26        SEND_VAL                                                 <true>
         27        DO_ICALL                                         $19     
         28        ASSIGN                                                   !3, $19
   20    29        CONCAT                                           ~21     'end%3A+', !3
         30        CONCAT                                           ~22     ~21, '%0A'
         31        ECHO                                                     ~22
   21    32        SUB                                              ~23     !3, !0
         33        CONCAT                                           ~24     'diff+end-start%3A+', ~23
         34        CONCAT                                           ~25     ~24, '%0A'
         35        ECHO                                                     ~25
         36      > RETURN                                                   1

Class Foo:
Function bar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qP0UE
function name:  bar
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
    8     3*     > RETURN                                                   null

End of function bar

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.76 ms | 1400 KiB | 15 Q