3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace Foo { class Bar { function __construct(){ echo get_called_class() . PHP_EOL; echo get_class($this) . PHP_EOL; echo __CLASS__ . PHP_EOL; echo get_class(self) . PHP_EOL; if (version_compare(PHP_VERSION, '5.5.0') >= 0) { echo Bar::class . PHP_EOL; } } } $oBar = new Bar(); } #EOF
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rQMb6
function name:  (null)
number of ops:  4
compiled vars:  !0 = $oBar
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   NEW                                              $1      'Foo%5CBar'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   20     3      > RETURN                                                   1

Class Foo\Bar:
Function __construct:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 29, Position 2 = 32
Branch analysis from position: 29
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 32
filename:       /in/rQMb6
function name:  __construct
number of ops:  33
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   INIT_NS_FCALL_BY_NAME                                    'Foo%5Cget_called_class'
          1        DO_FCALL                                      0  $0      
          2        FETCH_CONSTANT                                   ~1      'Foo%5CPHP_EOL'
          3        CONCAT                                           ~2      $0, ~1
          4        ECHO                                                     ~2
    8     5        INIT_NS_FCALL_BY_NAME                                    'Foo%5Cget_class'
          6        FETCH_THIS                                       $3      
          7        SEND_VAR_EX                                              $3
          8        DO_FCALL                                      0  $4      
          9        FETCH_CONSTANT                                   ~5      'Foo%5CPHP_EOL'
         10        CONCAT                                           ~6      $4, ~5
         11        ECHO                                                     ~6
    9    12        FETCH_CONSTANT                                   ~7      'Foo%5CPHP_EOL'
         13        CONCAT                                           ~8      'Foo%5CBar', ~7
         14        ECHO                                                     ~8
   10    15        INIT_NS_FCALL_BY_NAME                                    'Foo%5Cget_class'
         16        FETCH_CONSTANT                                   ~9      'Foo%5Cself'
         17        SEND_VAL_EX                                              ~9
         18        DO_FCALL                                      0  $10     
         19        FETCH_CONSTANT                                   ~11     'Foo%5CPHP_EOL'
         20        CONCAT                                           ~12     $10, ~11
         21        ECHO                                                     ~12
   11    22        INIT_NS_FCALL_BY_NAME                                    'Foo%5Cversion_compare'
         23        FETCH_CONSTANT                                   ~13     'Foo%5CPHP_VERSION'
         24        SEND_VAL_EX                                              ~13
         25        SEND_VAL_EX                                              '5.5.0'
         26        DO_FCALL                                      0  $14     
         27        IS_SMALLER_OR_EQUAL                                      0, $14
         28      > JMPZ                                                     ~15, ->32
   12    29    >   FETCH_CONSTANT                                   ~16     'Foo%5CPHP_EOL'
         30        CONCAT                                           ~17     'Foo%5CBar', ~16
         31        ECHO                                                     ~17
   14    32    > > RETURN                                                   null

End of function __construct

End of class Foo\Bar.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.27 ms | 1400 KiB | 19 Q