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('__get'); for ($i = $c; $i--;) { $a = new A(); for ($j = $c2; $j--;) { $x = $a->a1(); } } test('empty()'); for ($i = $c; $i--;) { $a = new A(); for ($j = $c2; $j--;) { $x = $a->a2(); } } test('fopen()');
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 = 34
Branch analysis from position: 34
2 jumps found. (Code = 44) Position 1 = 36, Position 2 = 24
Branch analysis from position: 36
1 jumps found. (Code = 42) Position 1 = 51
Branch analysis from position: 51
2 jumps found. (Code = 44) Position 1 = 53, Position 2 = 41
Branch analysis from position: 53
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 41
1 jumps found. (Code = 42) Position 1 = 49
Branch analysis from position: 49
2 jumps found. (Code = 44) Position 1 = 51, Position 2 = 46
Branch analysis from position: 51
Branch analysis from position: 46
2 jumps found. (Code = 44) Position 1 = 51, Position 2 = 46
Branch analysis from position: 51
Branch analysis from position: 46
Branch analysis from position: 24
1 jumps found. (Code = 42) Position 1 = 32
Branch analysis from position: 32
2 jumps found. (Code = 44) Position 1 = 34, Position 2 = 29
Branch analysis from position: 34
Branch analysis from position: 29
2 jumps found. (Code = 44) Position 1 = 34, Position 2 = 29
Branch analysis from position: 34
Branch analysis from position: 29
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/3D1YB
function name:  (null)
number of ops:  57
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                                                 '__get'
         21        DO_FCALL                                      0          
   44    22        ASSIGN                                                   !2, !0
         23      > JMP                                                      ->34
   45    24    >   NEW                                              $20     'A'
         25        DO_FCALL                                      0          
         26        ASSIGN                                                   !3, $20
   46    27        ASSIGN                                                   !4, !1
         28      > JMP                                                      ->32
   47    29    >   INIT_METHOD_CALL                                         !3, 'a1'
         30        DO_FCALL                                      0  $24     
         31        ASSIGN                                                   !5, $24
   46    32    >   POST_DEC                                         ~26     !4
         33      > JMPNZ                                                    ~26, ->29
   44    34    >   POST_DEC                                         ~27     !2
         35      > JMPNZ                                                    ~27, ->24
   50    36    >   INIT_FCALL                                               'test'
         37        SEND_VAL                                                 'empty%28%29'
         38        DO_FCALL                                      0          
   52    39        ASSIGN                                                   !2, !0
         40      > JMP                                                      ->51
   53    41    >   NEW                                              $30     'A'
         42        DO_FCALL                                      0          
         43        ASSIGN                                                   !3, $30
   54    44        ASSIGN                                                   !4, !1
         45      > JMP                                                      ->49
   55    46    >   INIT_METHOD_CALL                                         !3, 'a2'
         47        DO_FCALL                                      0  $34     
         48        ASSIGN                                                   !5, $34
   54    49    >   POST_DEC                                         ~36     !4
         50      > JMPNZ                                                    ~36, ->46
   52    51    >   POST_DEC                                         ~37     !2
         52      > JMPNZ                                                    ~37, ->41
   58    53    >   INIT_FCALL                                               'test'
         54        SEND_VAL                                                 'fopen%28%29'
         55        DO_FCALL                                      0          
         56      > 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/3D1YB
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/3D1YB
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/3D1YB
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/3D1YB
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/3D1YB
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:
149.1 ms | 1407 KiB | 23 Q