3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { const ALPHA = 1, BETA = 2, GAMMA = 3; public $a = "apple", $b = "bread", $c = "candy"; function showConstant( $c ){ /* switch( $c) { case "ALPHA": return self::ALPHA; break; case "BETA" : return self::BETA; break; case "GAMMA": return self::GAMA; break; }*/ return self::$c; } } echo (new Test)->showConstant( "BETA" );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/0FipB
function name:  (null)
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   NEW                                              $0      'Test'
          1        DO_FCALL                                      0          
          2        INIT_METHOD_CALL                                         $0, 'showConstant'
          3        SEND_VAL_EX                                              'BETA'
          4        DO_FCALL                                      0  $2      
          5        ECHO                                                     $2
          6      > RETURN                                                   1

Class Test:
Function showconstant:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/0FipB
function name:  showConstant
number of ops:  4
compiled vars:  !0 = $c
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
   12     1        FETCH_STATIC_PROP_R          unknown             ~1      'c'
          2      > RETURN                                                   ~1
   13     3*     > RETURN                                                   null

End of function showconstant

End of class Test.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
167.22 ms | 1393 KiB | 13 Q