3v4l.org

run code in 300+ PHP versions simultaneously
<?php if (PHP_VERSION !== '7.2.0alpha2') die('Meh'); function test($label = '') { global $t; $t2 = microtime(1); if ($label) echo str_pad($label . ': ', 32, '.', STR_PAD_RIGHT) . ' ' . 1000 * ($t2 - $t) . 'ms' . "\n"; $t = $t2; } $c = 1; $c2 = 1; class A { public $a = 123; public function __construct() { unset($this->a); } public function a1() { } public function a2() { fopen('php://input'); } public function __get($name) { return 321; } } test(); for ($i = $c; $i--;) { $a = new A(); for ($j = $c2; $j--;) { $x = $a->a; } } test('methods'); var_dump($x); for ($i = $c; $i--;) { $a = new A(); for ($j = $c2; $j--;) { $x = $a->a; } } test('methods'); var_dump($x);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 1, Position 2 = 2
Branch analysis from position: 1
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 2
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
2 jumps found. (Code = 44) Position 1 = 19, Position 2 = 8
Branch analysis from position: 19
1 jumps found. (Code = 42) Position 1 = 36
Branch analysis from position: 36
2 jumps found. (Code = 44) Position 1 = 38, Position 2 = 27
Branch analysis from position: 38
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 27
1 jumps found. (Code = 42) Position 1 = 34
Branch analysis from position: 34
2 jumps found. (Code = 44) Position 1 = 36, Position 2 = 32
Branch analysis from position: 36
Branch analysis from position: 32
2 jumps found. (Code = 44) Position 1 = 36, Position 2 = 32
Branch analysis from position: 36
Branch analysis from position: 32
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
2 jumps found. (Code = 44) Position 1 = 17, Position 2 = 13
Branch analysis from position: 17
Branch analysis from position: 13
2 jumps found. (Code = 44) Position 1 = 17, Position 2 = 13
Branch analysis from position: 17
Branch analysis from position: 13
filename:       /in/TWCCJ
function name:  (null)
number of ops:  45
compiled vars:  !0 = $c, !1 = $c2, !2 = $i, !3 = $a, !4 = $j, !5 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E > > JMPZ                                                     <true>, ->2
          1    > > EXIT                                                     'Meh'
   11     2    >   ASSIGN                                                   !0, 1
   12     3        ASSIGN                                                   !1, 1
   34     4        INIT_FCALL                                               'test'
          5        DO_FCALL                                      0          
   36     6        ASSIGN                                                   !2, !0
          7      > JMP                                                      ->17
   37     8    >   NEW                                              $10     'A'
          9        DO_FCALL                                      0          
         10        ASSIGN                                                   !3, $10
   38    11        ASSIGN                                                   !4, !1
         12      > JMP                                                      ->15
   39    13    >   FETCH_OBJ_R                                      ~14     !3, 'a'
         14        ASSIGN                                                   !5, ~14
   38    15    >   POST_DEC                                         ~16     !4
         16      > JMPNZ                                                    ~16, ->13
   36    17    >   POST_DEC                                         ~17     !2
         18      > JMPNZ                                                    ~17, ->8
   42    19    >   INIT_FCALL                                               'test'
         20        SEND_VAL                                                 'methods'
         21        DO_FCALL                                      0          
   43    22        INIT_FCALL                                               'var_dump'
         23        SEND_VAR                                                 !5
         24        DO_ICALL                                                 
   45    25        ASSIGN                                                   !2, !0
         26      > JMP                                                      ->36
   46    27    >   NEW                                              $21     'A'
         28        DO_FCALL                                      0          
         29        ASSIGN                                                   !3, $21
   47    30        ASSIGN                                                   !4, !1
         31      > JMP                                                      ->34
   48    32    >   FETCH_OBJ_R                                      ~25     !3, 'a'
         33        ASSIGN                                                   !5, ~25
   47    34    >   POST_DEC                                         ~27     !4
         35      > JMPNZ                                                    ~27, ->32
   45    36    >   POST_DEC                                         ~28     !2
         37      > JMPNZ                                                    ~28, ->27
   51    38    >   INIT_FCALL                                               'test'
         39        SEND_VAL                                                 'methods'
         40        DO_FCALL                                      0          
   52    41        INIT_FCALL                                               'var_dump'
         42        SEND_VAR                                                 !5
         43        DO_ICALL                                                 
         44      > RETURN                                                   1

Function test:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 21
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 21
filename:       /in/TWCCJ
function name:  test
number of ops:  23
compiled vars:  !0 = $label, !1 = $t, !2 = $t2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV_INIT                                        !0      ''
    5     1        BIND_GLOBAL                                              !1, 't'
    6     2        INIT_FCALL                                               'microtime'
          3        SEND_VAL                                                 1
          4        DO_ICALL                                         $3      
          5        ASSIGN                                                   !2, $3
    7     6      > JMPZ                                                     !0, ->21
          7    >   INIT_FCALL                                               'str_pad'
          8        CONCAT                                           ~5      !0, '%3A+'
          9        SEND_VAL                                                 ~5
         10        SEND_VAL                                                 32
         11        SEND_VAL                                                 '.'
         12        SEND_VAL                                                 1
         13        DO_ICALL                                         $6      
         14        CONCAT                                           ~7      $6, '+'
         15        SUB                                              ~8      !2, !1
         16        MUL                                              ~9      ~8, 1000
         17        CONCAT                                           ~10     ~7, ~9
         18        CONCAT                                           ~11     ~10, 'ms'
         19        CONCAT                                           ~12     ~11, '%0A'
         20        ECHO                                                     ~12
    8    21    >   ASSIGN                                                   !1, !2
    9    22      > RETURN                                                   null

End of function test

Class A:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/TWCCJ
function name:  __construct
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   UNSET_OBJ                                                'a'
   19     1      > RETURN                                                   null

End of function __construct

Function a1:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/TWCCJ
function name:  a1
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   23     0  E > > RETURN                                                   null

End of function a1

Function a2:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/TWCCJ
function name:  a2
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   26     0  E >   INIT_FCALL                                               'fopen'
          1        SEND_VAL                                                 'php%3A%2F%2Finput'
          2        DO_ICALL                                                 
   27     3      > RETURN                                                   null

End of function a2

Function __get:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/TWCCJ
function name:  __get
number of ops:  3
compiled vars:  !0 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   29     0  E >   RECV                                             !0      
   30     1      > RETURN                                                   321
   31     2*     > RETURN                                                   null

End of function __get

End of class A.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.89 ms | 1407 KiB | 24 Q