3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { function bar() { $nothing = isset($this) ? 'Instance' : 'Class'; } } class Baz { function test() { $objDateTime = new DateTime('NOW'); $debut = $objDateTime->getTimeStamp(); for($index=1; $index <100; $index++) { Foo::bar(); } $objDateTime = new DateTime('NOW'); $fin = $objDateTime->getTimeStamp(); echo 'Baz->test()::' . $fin-$debut; } } $baz = new Baz; $baz->test(); class FooPropre { public static function barPropre() { $nothing = isset($this) ? 'Instance' : 'Class'; } } class BazPropre { function testPropre() { $objDateTime = new DateTime('NOW'); $debut = $objDateTime->getTimeStamp(); for($index=1; $index <100; $index++) { FooPropre::barPropre(); } $objDateTime = new DateTime('NOW'); $fin = $objDateTime->getTimeStamp(); echo 'BazPropre->testPropre()::' . $fin-$debut; } } $bazp = new BazPropre; $bazp->testPropre();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mX8Nm
function name:  (null)
number of ops:  11
compiled vars:  !0 = $baz, !1 = $bazp
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   NEW                                              $2      'Baz'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   21     3        INIT_METHOD_CALL                                         !0, 'test'
          4        DO_FCALL                                      0          
   41     5        NEW                                              $6      'BazPropre'
          6        DO_FCALL                                      0          
          7        ASSIGN                                                   !1, $6
   42     8        INIT_METHOD_CALL                                         !1, 'testPropre'
          9        DO_FCALL                                      0          
         10      > RETURN                                                   1

Class Foo:
Function bar:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 2, Position 2 = 4
Branch analysis from position: 2
1 jumps found. (Code = 42) Position 1 = 5
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mX8Nm
function name:  bar
number of ops:  7
compiled vars:  !0 = $nothing
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ISSET_ISEMPTY_THIS                               ~1      
          1      > JMPZ                                                     ~1, ->4
          2    >   QM_ASSIGN                                        ~2      'Instance'
          3      > JMP                                                      ->5
          4    >   QM_ASSIGN                                        ~2      'Class'
          5    >   ASSIGN                                                   !0, ~2
    5     6      > RETURN                                                   null

End of function bar

End of class Foo.

Class Baz:
Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
2 jumps found. (Code = 44) Position 1 = 14, Position 2 = 9
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
2 jumps found. (Code = 44) Position 1 = 14, Position 2 = 9
Branch analysis from position: 14
Branch analysis from position: 9
filename:       /in/mX8Nm
function name:  test
number of ops:  25
compiled vars:  !0 = $objDateTime, !1 = $debut, !2 = $index, !3 = $fin
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   NEW                                              $4      'DateTime'
          1        SEND_VAL_EX                                              'NOW'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $4
   10     4        INIT_METHOD_CALL                                         !0, 'getTimeStamp'
          5        DO_FCALL                                      0  $7      
          6        ASSIGN                                                   !1, $7
   11     7        ASSIGN                                                   !2, 1
          8      > JMP                                                      ->12
   12     9    >   INIT_STATIC_METHOD_CALL                                  'Foo', 'bar'
         10        DO_FCALL                                      0          
   11    11        PRE_INC                                                  !2
         12    >   IS_SMALLER                                               !2, 100
         13      > JMPNZ                                                    ~12, ->9
   14    14    >   NEW                                              $13     'DateTime'
         15        SEND_VAL_EX                                              'NOW'
         16        DO_FCALL                                      0          
         17        ASSIGN                                                   !0, $13
   15    18        INIT_METHOD_CALL                                         !0, 'getTimeStamp'
         19        DO_FCALL                                      0  $16     
         20        ASSIGN                                                   !3, $16
   16    21        SUB                                              ~18     !3, !1
         22        CONCAT                                           ~19     'Baz-%3Etest%28%29%3A%3A', ~18
         23        ECHO                                                     ~19
   17    24      > RETURN                                                   null

End of function test

End of class Baz.

Class FooPropre:
Function barpropre:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 2, Position 2 = 4
Branch analysis from position: 2
1 jumps found. (Code = 42) Position 1 = 5
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mX8Nm
function name:  barPropre
number of ops:  7
compiled vars:  !0 = $nothing
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E >   ISSET_ISEMPTY_THIS                               ~1      
          1      > JMPZ                                                     ~1, ->4
          2    >   QM_ASSIGN                                        ~2      'Instance'
          3      > JMP                                                      ->5
          4    >   QM_ASSIGN                                        ~2      'Class'
          5    >   ASSIGN                                                   !0, ~2
   26     6      > RETURN                                                   null

End of function barpropre

End of class FooPropre.

Class BazPropre:
Function testpropre:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
2 jumps found. (Code = 44) Position 1 = 14, Position 2 = 9
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
2 jumps found. (Code = 44) Position 1 = 14, Position 2 = 9
Branch analysis from position: 14
Branch analysis from position: 9
filename:       /in/mX8Nm
function name:  testPropre
number of ops:  25
compiled vars:  !0 = $objDateTime, !1 = $debut, !2 = $index, !3 = $fin
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   30     0  E >   NEW                                              $4      'DateTime'
          1        SEND_VAL_EX                                              'NOW'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $4
   31     4        INIT_METHOD_CALL                                         !0, 'getTimeStamp'
          5        DO_FCALL                                      0  $7      
          6        ASSIGN                                                   !1, $7
   32     7        ASSIGN                                                   !2, 1
          8      > JMP                                                      ->12
   33     9    >   INIT_STATIC_METHOD_CALL                                  'FooPropre', 'barPropre'
         10        DO_FCALL                                      0          
   32    11        PRE_INC                                                  !2
         12    >   IS_SMALLER                                               !2, 100
         13      > JMPNZ                                                    ~12, ->9
   35    14    >   NEW                                              $13     'DateTime'
         15        SEND_VAL_EX                                              'NOW'
         16        DO_FCALL                                      0          
         17        ASSIGN                                                   !0, $13
   36    18        INIT_METHOD_CALL                                         !0, 'getTimeStamp'
         19        DO_FCALL                                      0  $16     
         20        ASSIGN                                                   !3, $16
   37    21        SUB                                              ~18     !3, !1
         22        CONCAT                                           ~19     'BazPropre-%3EtestPropre%28%29%3A%3A', ~18
         23        ECHO                                                     ~19
   38    24      > RETURN                                                   null

End of function testpropre

End of class BazPropre.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.19 ms | 1403 KiB | 13 Q