3v4l.org

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

Class Test: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
222.22 ms | 1399 KiB | 17 Q