3v4l.org

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

Class Test: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
176.89 ms | 1395 KiB | 17 Q