3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test{ const ♥ = "love"; } $class = new ReflectionClass("Test"); $constant = "♥"; if ( $class->hasConstant( $constant ) ) { $bad_char = "♥"; if ( mb_strpos( $constant, $bad_char) !== false ) { exit( "Illegal identifier: $bad_char" ); } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 19
Branch analysis from position: 9
2 jumps found. (Code = 43) Position 1 = 16, Position 2 = 19
Branch analysis from position: 16
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
filename:       /in/m0Qcm
function name:  (null)
number of ops:  20
compiled vars:  !0 = $class, !1 = $constant, !2 = $bad_char
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   NEW                                              $3      'ReflectionClass'
          1        SEND_VAL_EX                                              'Test'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $3
    8     4        ASSIGN                                                   !1, '%E2%99%A5'
    9     5        INIT_METHOD_CALL                                         !0, 'hasConstant'
          6        SEND_VAR_EX                                              !1
          7        DO_FCALL                                      0  $7      
          8      > JMPZ                                                     $7, ->19
   10     9    >   ASSIGN                                                   !2, '%E2%99%A5'
   11    10        INIT_FCALL                                               'mb_strpos'
         11        SEND_VAR                                                 !1
         12        SEND_VAR                                                 !2
         13        DO_ICALL                                         $9      
         14        TYPE_CHECK                                  1018          $9
         15      > JMPZ                                                     ~10, ->19
   13    16    >   NOP                                                      
         17        FAST_CONCAT                                      ~11     'Illegal+identifier%3A+', !2
         18      > EXIT                                                     ~11
   16    19    > > RETURN                                                   1

Class Test: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.15 ms | 1395 KiB | 15 Q