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'); echo 'Baz->test()::DEBUT: ' . $objDateTime->format('c'); for($index=1; $index <10000; $index++) { Foo::bar(); } $objDateTime = new DateTime('NOW'); echo 'Baz->test()::FIN: ' . $objDateTime->format('c'); } } $baz = new Baz; $baz->test(); class FooPropre { public static function barPropre() { $nothing = isset($this) ? 'Instance' : 'Class'; } } class BazPropre { function testPropre() { $objDateTime = new DateTime('NOW'); echo 'BazPropre->testPropre()::DEBUT: ' . $objDateTime->format('c'); for($index=1; $index <10000; $index++) { FooPropre::barPropre(); } $objDateTime = new DateTime('NOW'); echo 'BazPropre->testPropre()::FIN: ' . $objDateTime->format('c'); } } $baz = new BazPropre; $baz->testPropre();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fUccs
function name:  (null)
number of ops:  11
compiled vars:  !0 = $baz
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   NEW                                              $1      'Baz'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   20     3        INIT_METHOD_CALL                                         !0, 'test'
          4        DO_FCALL                                      0          
   39     5        NEW                                              $5      'BazPropre'
          6        DO_FCALL                                      0          
          7        ASSIGN                                                   !0, $5
   40     8        INIT_METHOD_CALL                                         !0, '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/fUccs
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 = 14
Branch analysis from position: 14
2 jumps found. (Code = 44) Position 1 = 16, Position 2 = 11
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
2 jumps found. (Code = 44) Position 1 = 16, Position 2 = 11
Branch analysis from position: 16
Branch analysis from position: 11
filename:       /in/fUccs
function name:  test
number of ops:  26
compiled vars:  !0 = $objDateTime, !1 = $index
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   NEW                                              $2      'DateTime'
          1        SEND_VAL_EX                                              'NOW'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $2
   10     4        INIT_METHOD_CALL                                         !0, 'format'
          5        SEND_VAL_EX                                              'c'
          6        DO_FCALL                                      0  $5      
          7        CONCAT                                           ~6      'Baz-%3Etest%28%29%3A%3ADEBUT%3A+', $5
          8        ECHO                                                     ~6
   11     9        ASSIGN                                                   !1, 1
         10      > JMP                                                      ->14
   12    11    >   INIT_STATIC_METHOD_CALL                                  'Foo', 'bar'
         12        DO_FCALL                                      0          
   11    13        PRE_INC                                                  !1
         14    >   IS_SMALLER                                               !1, 10000
         15      > JMPNZ                                                    ~10, ->11
   14    16    >   NEW                                              $11     'DateTime'
         17        SEND_VAL_EX                                              'NOW'
         18        DO_FCALL                                      0          
         19        ASSIGN                                                   !0, $11
   15    20        INIT_METHOD_CALL                                         !0, 'format'
         21        SEND_VAL_EX                                              'c'
         22        DO_FCALL                                      0  $14     
         23        CONCAT                                           ~15     'Baz-%3Etest%28%29%3A%3AFIN%3A+', $14
         24        ECHO                                                     ~15
   16    25      > 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/fUccs
function name:  barPropre
number of ops:  7
compiled vars:  !0 = $nothing
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     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
   25     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 = 14
Branch analysis from position: 14
2 jumps found. (Code = 44) Position 1 = 16, Position 2 = 11
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
2 jumps found. (Code = 44) Position 1 = 16, Position 2 = 11
Branch analysis from position: 16
Branch analysis from position: 11
filename:       /in/fUccs
function name:  testPropre
number of ops:  26
compiled vars:  !0 = $objDateTime, !1 = $index
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   29     0  E >   NEW                                              $2      'DateTime'
          1        SEND_VAL_EX                                              'NOW'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $2
   30     4        INIT_METHOD_CALL                                         !0, 'format'
          5        SEND_VAL_EX                                              'c'
          6        DO_FCALL                                      0  $5      
          7        CONCAT                                           ~6      'BazPropre-%3EtestPropre%28%29%3A%3ADEBUT%3A+', $5
          8        ECHO                                                     ~6
   31     9        ASSIGN                                                   !1, 1
         10      > JMP                                                      ->14
   32    11    >   INIT_STATIC_METHOD_CALL                                  'FooPropre', 'barPropre'
         12        DO_FCALL                                      0          
   31    13        PRE_INC                                                  !1
         14    >   IS_SMALLER                                               !1, 10000
         15      > JMPNZ                                                    ~10, ->11
   34    16    >   NEW                                              $11     'DateTime'
         17        SEND_VAL_EX                                              'NOW'
         18        DO_FCALL                                      0          
         19        ASSIGN                                                   !0, $11
   35    20        INIT_METHOD_CALL                                         !0, 'format'
         21        SEND_VAL_EX                                              'c'
         22        DO_FCALL                                      0  $14     
         23        CONCAT                                           ~15     'BazPropre-%3EtestPropre%28%29%3A%3AFIN%3A+', $14
         24        ECHO                                                     ~15
   36    25      > RETURN                                                   null

End of function testpropre

End of class BazPropre.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
141.36 ms | 1403 KiB | 13 Q