3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Mocking WordPress function add_filter(string $tag, callable $value) { $GLOBALS[$tag][] = $value; } function _doing_it_wrong($fn, string $message) { echo "\n--------------\nDOING IT WRONG: $message\n--------------\n"; } // ------------------------------------------------------------------ function apply_filters_typesafe( $tag, $arguments = array(), $value = null, ...$values ) { if ( null === $value || empty( $GLOBALS[$tag] ) ) { return apply_filters( $tag, $value, ...$values ); } $type = gettype( $value ); $is_object = false; switch ( $type ) { case 'boolean': $accepted_types = array( 'boolean' ); break; case 'integer': case 'double': $accepted_types = array( 'numeric' ); break; case 'string': $accepted_types = array( 'string' ); break; case 'array': $accepted_types = array( 'array' ); break; case 'resource': case 'resource (closed)': $accepted_types = array( 'resource' ); break; case 'object': $is_object = true; default: $accepted_types = array(); } // Skip calculation of accepted types if they are are explicitly passed. if ( $is_object && empty ( $arguments['accepted_types'] ) ) { $class = get_class( $value ); $accepted_types = array( $class ); $parent = get_parent_class( $class ); while ( $parent ) { $accepted_types[] = $parent; $parent = get_parent_class( $parent ); } $accepted_types = array_merge( $accepted_types, class_implements( $class ) ); } $arguments = array_replace( array( 'nullable' => false, 'accepted_types' => $accepted_types ), $arguments ); $original = $value; // Objects are passed by ref, clone to return original unchanged in case of errors. $to_filter = $is_object ? clone $value : $value; $filter = array_shift($GLOBALS[$tag]); $filtered = $filter( $tag, $to_filter, ...$values ); // 'mixed' is a valid PHP 8 pseudo-type so we support for consistency. // That said, if mixed is fine then just use apply_filters. if ( in_array( 'mixed', (array)$arguments['accepted_types'] ) ) { return $GLOBALS[$tag] ? apply_filters_typesafe( $tag, $arguments, $filtered, ...$values ) : $filtered; } static $can_do_it_wrong = false; if ( ! $can_do_it_wrong && function_exists( '_doing_it_wrong' ) ) { $can_do_it_wrong = true; } if ( ( null === $filtered && !$arguments['nullable'] ) ) { if ( $can_do_it_wrong ) { _doing_it_wrong( __FUNCTION__, "Filters for $tag where not expected to return null.", '5.6' ); } return $GLOBALS[$tag] ? apply_filters_typesafe( $tag, $arguments, $original, ...$values ) : $filtered; } static $functions; if ( ! $functions ) { $functions = array( 'integer' => 'is_int', 'double' => 'is_float', 'float' => 'is_float', 'numeric' => 'is_numeric', 'number' => 'is_numeric', 'bool' => 'is_bool', 'boolean' => 'is_boolean', 'string' => 'is_string', 'array' => 'is_array', 'callable' => 'is_callable', 'function' => 'is_callable', 'resource' => 'is_resource', 'iterable' => 'is_iterable', 'countable' => 'is_countable', ); } foreach ( $arguments['accepted_types'] as $type ) { if ( isset( $functions[ $type ] ) && call_user_func( $functions[ $type ], $filtered ) ) { return $GLOBALS[$tag] ? apply_filters_typesafe( $tag, $arguments, $filtered, ...$values ) : $filtered; } if ( $is_object && is_string ( $type ) && is_a( $filtered, $type ) ) { return $GLOBALS[$tag] ? apply_filters_typesafe( $tag, $arguments, $filtered, ...$values ) : $filtered; } } if ( $can_do_it_wrong ) { $expected = implode( ', ', $arguments['accepted_types'] ); $actual = is_object( $filtered ) ? 'instance of ' . get_class($filtered) : gettype( $filtered ); _doing_it_wrong( __FUNCTION__, "Filters for $tag where expected to return a value of one of types $expected. Got $actual instead.", '5.6' ); } return $GLOBALS[$tag] ? apply_filters_typesafe( $tag, $arguments, $original, ...$values ) : $filtered; } // Let's try now to add some hooks, the first is bad, the second is good. add_filter('hello', function () { return 'This is not a callable' ; }); add_filter('hello', function () { return function () { return 'It works!'; }; }); // And lets' see if it works: $callable = apply_filters_typesafe('hello', ['accepted_types' => ['callable']], '__return_empty_string'); echo $callable();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/d3oBi
function name:  (null)
number of ops:  20
compiled vars:  !0 = $callable
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  153     0  E >   INIT_FCALL                                               'add_filter'
          1        SEND_VAL                                                 'hello'
          2        DECLARE_LAMBDA_FUNCTION                          ~1      [0]
  155     3        SEND_VAL                                                 ~1
  153     4        DO_FCALL                                      0          
  157     5        INIT_FCALL                                               'add_filter'
          6        SEND_VAL                                                 'hello'
          7        DECLARE_LAMBDA_FUNCTION                          ~3      [1]
  161     8        SEND_VAL                                                 ~3
  157     9        DO_FCALL                                      0          
  166    10        INIT_FCALL                                               'apply_filters_typesafe'
         11        SEND_VAL                                                 'hello'
         12        SEND_VAL                                                 <array>
         13        SEND_VAL                                                 '__return_empty_string'
         14        DO_FCALL                                      0  $5      
         15        ASSIGN                                                   !0, $5
  167    16        INIT_DYNAMIC_CALL                                        !0
         17        DO_FCALL                                      0  $7      
         18        ECHO                                                     $7
         19      > RETURN                                                   1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/d3oBi
function name:  {closure}
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  154     0  E > > RETURN                                                   'This+is+not+a+callable'
  155     1*     > RETURN                                                   null

End of Dynamic Function 0

Dynamic Function 1
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/d3oBi
function name:  {closure}
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  158     0  E >   DECLARE_LAMBDA_FUNCTION                          ~0      [0]
  160     1      > RETURN                                                   ~0
  161     2*     > RETURN                                                   null


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/d3oBi
function name:  {closure}
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  159     0  E > > RETURN                                                   'It+works%21'
  160     1*     > RETURN                                                   null

End of Dynamic Function 0

End of Dynamic Function 1

Function add_filter:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/d3oBi
function name:  add_filter
number of ops:  6
compiled vars:  !0 = $tag, !1 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    4     2        FETCH_W                      global              $2      !0
          3        ASSIGN_DIM                                               $2
          4        OP_DATA                                                  !1
    5     5      > RETURN                                                   null

End of function add_filter

Function _doing_it_wrong:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/d3oBi
function name:  _doing_it_wrong
number of ops:  7
compiled vars:  !0 = $fn, !1 = $message
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    8     2        ROPE_INIT                                     3  ~3      '%0A--------------%0ADOING+IT+WRONG%3A+'
          3        ROPE_ADD                                      1  ~3      ~3, !1
          4        ROPE_END                                      2  ~2      ~3, '%0A--------------%0A'
          5        ECHO                                                     ~2
    9     6      > RETURN                                                   null

End of function _doing_it_wrong

Function apply_filters_typesafe:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 47) Position 1 = 6, Position 2 = 8
Branch analysis from position: 6
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 16
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
10 jumps found. (Code = 188) Position 1 = 37, Position 2 = 39, Position 3 = 39, Position 4 = 41, Position 5 = 43, Position 6 = 45, Position 7 = 45, Position 8 = 47, Position 9 = 48, Position 10 = 20
Branch analysis from position: 37
1 jumps found. (Code = 42) Position 1 = 49
Branch analysis from position: 49
2 jumps found. (Code = 46) Position 1 = 50, Position 2 = 52
Branch analysis from position: 50
2 jumps found. (Code = 43) Position 1 = 53, Position 2 = 77
Branch analysis from position: 53
1 jumps found. (Code = 42) Position 1 = 68
Branch analysis from position: 68
2 jumps found. (Code = 44) Position 1 = 69, Position 2 = 62
Branch analysis from position: 69
2 jumps found. (Code = 43) Position 1 = 86, Position 2 = 89
Branch analysis from position: 86
1 jumps found. (Code = 42) Position 1 = 90
Branch analysis from position: 90
2 jumps found. (Code = 43) Position 1 = 110, Position 2 = 123
Branch analysis from position: 110
2 jumps found. (Code = 43) Position 1 = 112, Position 2 = 121
Branch analysis from position: 112
1 jumps found. (Code = 42) Position 1 = 122
Branch analysis from position: 122
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 121
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 123
2 jumps found. (Code = 46) Position 1 = 126, Position 2 = 130
Branch analysis from position: 126
2 jumps found. (Code = 43) Position 1 = 131, Position 2 = 132
Branch analysis from position: 131
2 jumps found. (Code = 46) Position 1 = 134, Position 2 = 137
Branch analysis from position: 134
2 jumps found. (Code = 43) Position 1 = 138, Position 2 = 160
Branch analysis from position: 138
2 jumps found. (Code = 43) Position 1 = 139, Position 2 = 147
Branch analysis from position: 139
2 jumps found. (Code = 43) Position 1 = 149, Position 2 = 158
Branch analysis from position: 149
1 jumps found. (Code = 42) Position 1 = 159
Branch analysis from position: 159
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 158
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 147
Branch analysis from position: 160
2 jumps found. (Code = 43) Position 1 = 163, Position 2 = 164
Branch analysis from position: 163
2 jumps found. (Code = 77) Position 1 = 166, Position 2 = 214
Branch analysis from position: 166
2 jumps found. (Code = 78) Position 1 = 167, Position 2 = 214
Branch analysis from position: 167
2 jumps found. (Code = 46) Position 1 = 169, Position 2 = 174
Branch analysis from position: 169
2 jumps found. (Code = 43) Position 1 = 175, Position 2 = 189
Branch analysis from position: 175
2 jumps found. (Code = 43) Position 1 = 177, Position 2 = 186
Branch analysis from position: 177
1 jumps found. (Code = 42) Position 1 = 187
Branch analysis from position: 187
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 186
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 189
2 jumps found. (Code = 46) Position 1 = 190, Position 2 = 192
Branch analysis from position: 190
2 jumps found. (Code = 46) Position 1 = 193, Position 2 = 198
Branch analysis from position: 193
2 jumps found. (Code = 43) Position 1 = 199, Position 2 = 213
Branch analysis from position: 199
2 jumps found. (Code = 43) Position 1 = 201, Position 2 = 210
Branch analysis from position: 201
1 jumps found. (Code = 42) Position 1 = 211
Branch analysis from position: 211
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 210
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 213
1 jumps found. (Code = 42) Position 1 = 166
Branch analysis from position: 166
Branch analysis from position: 198
Branch analysis from position: 192
Branch analysis from position: 174
Branch analysis from position: 214
2 jumps found. (Code = 43) Position 1 = 216, Position 2 = 243
Branch analysis from position: 216
2 jumps found. (Code = 43) Position 1 = 224, Position 2 = 228
Branch analysis from position: 224
1 jumps found. (Code = 42) Position 1 = 230
Branch analysis from position: 230
2 jumps found. (Code = 43) Position 1 = 245, Position 2 = 254
Branch analysis from position: 245
1 jumps found. (Code = 42) Position 1 = 255
Branch analysis from position: 255
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 254
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 228
2 jumps found. (Code = 43) Position 1 = 245, Position 2 = 254
Branch analysis from position: 245
Branch analysis from position: 254
Branch analysis from position: 243
Branch analysis from position: 214
Branch analysis from position: 164
Branch analysis from position: 137
Branch analysis from position: 132
Branch analysis from position: 130
Branch analysis from position: 89
2 jumps found. (Code = 43) Position 1 = 110, Position 2 = 123
Branch analysis from position: 110
Branch analysis from position: 123
Branch analysis from position: 62
2 jumps found. (Code = 44) Position 1 = 69, Position 2 = 62
Branch analysis from position: 69
Branch analysis from position: 62
Branch analysis from position: 77
Branch analysis from position: 52
Branch analysis from position: 39
1 jumps found. (Code = 42) Position 1 = 49
Branch analysis from position: 49
Branch analysis from position: 39
Branch analysis from position: 41
1 jumps found. (Code = 42) Position 1 = 49
Branch analysis from position: 49
Branch analysis from position: 43
1 jumps found. (Code = 42) Position 1 = 49
Branch analysis from position: 49
Branch analysis from position: 45
1 jumps found. (Code = 42) Position 1 = 49
Branch analysis from position: 49
Branch analysis from position: 45
Branch analysis from position: 47
2 jumps found. (Code = 46) Position 1 = 50, Position 2 = 52
Branch analysis from position: 50
Branch analysis from position: 52
Branch analysis from position: 48
Branch analysis from position: 20
2 jumps found. (Code = 44) Position 1 = 22, Position 2 = 37
Branch analysis from position: 22
2 jumps found. (Code = 44) Position 1 = 24, Position 2 = 39
Branch analysis from position: 24
2 jumps found. (Code = 44) Position 1 = 26, Position 2 = 39
Branch analysis from position: 26
2 jumps found. (Code = 44) Position 1 = 28, Position 2 = 41
Branch analysis from position: 28
2 jumps found. (Code = 44) Position 1 = 30, Position 2 = 43
Branch analysis from position: 30
2 jumps found. (Code = 44) Position 1 = 32, Position 2 = 45
Branch analysis from position: 32
2 jumps found. (Code = 44) Position 1 = 34, Position 2 = 45
Branch analysis from position: 34
2 jumps found. (Code = 44) Position 1 = 36, Position 2 = 47
Branch analysis from position: 36
1 jumps found. (Code = 42) Position 1 = 48
Branch analysis from position: 48
Branch analysis from position: 47
Branch analysis from position: 45
Branch analysis from position: 45
Branch analysis from position: 43
Branch analysis from position: 41
Branch analysis from position: 39
Branch analysis from position: 39
Branch analysis from position: 37
Branch analysis from position: 8
filename:       /in/d3oBi
function name:  apply_filters_typesafe
number of ops:  257
compiled vars:  !0 = $tag, !1 = $arguments, !2 = $value, !3 = $values, !4 = $type, !5 = $is_object, !6 = $accepted_types, !7 = $class, !8 = $parent, !9 = $original, !10 = $to_filter, !11 = $filter, !12 = $filtered, !13 = $can_do_it_wrong, !14 = $functions, !15 = $expected, !16 = $actual
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   RECV                                             !0      
          1        RECV_INIT                                        !1      <array>
          2        RECV_INIT                                        !2      null
          3        RECV_VARIADIC                                    !3      
   15     4        TYPE_CHECK                                    2  ~17     !2
          5      > JMPNZ_EX                                         ~17     ~17, ->8
          6    >   ISSET_ISEMPTY_VAR                             3  ~18     !0
          7        BOOL                                             ~17     ~18
          8    > > JMPZ                                                     ~17, ->16
   16     9    >   INIT_FCALL_BY_NAME                                       'apply_filters'
         10        SEND_VAR_EX                                              !0
         11        SEND_VAR_EX                                              !2
         12        SEND_UNPACK                                              !3
         13        CHECK_UNDEF_ARGS                                         
         14        DO_FCALL                                      1  $19     
         15      > RETURN                                                   $19
   19    16    >   GET_TYPE                                         ~20     !2
         17        ASSIGN                                                   !4, ~20
   20    18        ASSIGN                                                   !5, <false>
   21    19      > SWITCH_STRING                                            !4, [ 'boolean':->37, 'integer':->39, 'double':->39, 'string':->41, 'array':->43, 'resource':->45, 'resource+%28closed%29':->45, 'object':->47, ], ->48
   22    20    >   IS_EQUAL                                                 !4, 'boolean'
         21      > JMPNZ                                                    ~23, ->37
   25    22    >   IS_EQUAL                                                 !4, 'integer'
         23      > JMPNZ                                                    ~23, ->39
   26    24    >   IS_EQUAL                                                 !4, 'double'
         25      > JMPNZ                                                    ~23, ->39
   29    26    >   IS_EQUAL                                                 !4, 'string'
         27      > JMPNZ                                                    ~23, ->41
   32    28    >   IS_EQUAL                                                 !4, 'array'
         29      > JMPNZ                                                    ~23, ->43
   35    30    >   IS_EQUAL                                                 !4, 'resource'
         31      > JMPNZ                                                    ~23, ->45
   36    32    >   IS_EQUAL                                                 !4, 'resource+%28closed%29'
         33      > JMPNZ                                                    ~23, ->45
   39    34    >   IS_EQUAL                                                 !4, 'object'
         35      > JMPNZ                                                    ~23, ->47
         36    > > JMP                                                      ->48
   23    37    >   ASSIGN                                                   !6, <array>
   24    38      > JMP                                                      ->49
   27    39    >   ASSIGN                                                   !6, <array>
   28    40      > JMP                                                      ->49
   30    41    >   ASSIGN                                                   !6, <array>
   31    42      > JMP                                                      ->49
   33    43    >   ASSIGN                                                   !6, <array>
   34    44      > JMP                                                      ->49
   37    45    >   ASSIGN                                                   !6, <array>
   38    46      > JMP                                                      ->49
   40    47    >   ASSIGN                                                   !5, <true>
   42    48    >   ASSIGN                                                   !6, <array>
   46    49    > > JMPZ_EX                                          ~31     !5, ->52
         50    >   ISSET_ISEMPTY_DIM_OBJ                         1  ~32     !1, 'accepted_types'
         51        BOOL                                             ~31     ~32
         52    > > JMPZ                                                     ~31, ->77
   47    53    >   GET_CLASS                                        ~33     !2
         54        ASSIGN                                                   !7, ~33
   48    55        INIT_ARRAY                                       ~35     !7
         56        ASSIGN                                                   !6, ~35
   49    57        INIT_FCALL                                               'get_parent_class'
         58        SEND_VAR                                                 !7
         59        DO_ICALL                                         $37     
         60        ASSIGN                                                   !8, $37
   50    61      > JMP                                                      ->68
   51    62    >   ASSIGN_DIM                                               !6
         63        OP_DATA                                                  !8
   52    64        INIT_FCALL                                               'get_parent_class'
         65        SEND_VAR                                                 !8
         66        DO_ICALL                                         $40     
         67        ASSIGN                                                   !8, $40
   50    68    > > JMPNZ                                                    !8, ->62
   55    69    >   INIT_FCALL                                               'array_merge'
         70        SEND_VAR                                                 !6
         71        INIT_FCALL                                               'class_implements'
         72        SEND_VAR                                                 !7
         73        DO_ICALL                                         $42     
         74        SEND_VAR                                                 $42
         75        DO_ICALL                                         $43     
         76        ASSIGN                                                   !6, $43
   58    77    >   INIT_FCALL                                               'array_replace'
   60    78        INIT_ARRAY                                       ~45     <false>, 'nullable'
   61    79        ADD_ARRAY_ELEMENT                                ~45     !6, 'accepted_types'
         80        SEND_VAL                                                 ~45
   63    81        SEND_VAR                                                 !1
   58    82        DO_ICALL                                         $46     
         83        ASSIGN                                                   !1, $46
   66    84        ASSIGN                                                   !9, !2
   68    85      > JMPZ                                                     !5, ->89
         86    >   CLONE                                            ~49     !2
         87        QM_ASSIGN                                        ~50     ~49
         88      > JMP                                                      ->90
         89    >   QM_ASSIGN                                        ~50     !2
         90    >   ASSIGN                                                   !10, ~50
   70    91        INIT_FCALL                                               'array_shift'
         92        FETCH_W                      global              $52     !0
         93        SEND_REF                                                 $52
         94        DO_ICALL                                         $53     
         95        ASSIGN                                                   !11, $53
   72    96        INIT_DYNAMIC_CALL                                        !11
         97        SEND_VAR_EX                                              !0
         98        SEND_VAR_EX                                              !10
         99        SEND_UNPACK                                              !3
        100        CHECK_UNDEF_ARGS                                         
        101        DO_FCALL                                      1  $55     
        102        ASSIGN                                                   !12, $55
   76   103        INIT_FCALL                                               'in_array'
        104        SEND_VAL                                                 'mixed'
        105        FETCH_DIM_R                                      ~57     !1, 'accepted_types'
        106        CAST                                          7  ~58     ~57
        107        SEND_VAL                                                 ~58
        108        DO_ICALL                                         $59     
        109      > JMPZ                                                     $59, ->123
   77   110    >   FETCH_R                      global              ~60     !0
        111      > JMPZ                                                     ~60, ->121
   78   112    >   INIT_FCALL_BY_NAME                                       'apply_filters_typesafe'
        113        SEND_VAR_EX                                              !0
        114        SEND_VAR_EX                                              !1
        115        SEND_VAR_EX                                              !12
        116        SEND_UNPACK                                              !3
        117        CHECK_UNDEF_ARGS                                         
        118        DO_FCALL                                      1  $61     
        119        QM_ASSIGN                                        ~62     $61
        120      > JMP                                                      ->122
   79   121    >   QM_ASSIGN                                        ~62     !12
        122    > > RETURN                                                   ~62
   82   123    >   BIND_STATIC                                              !13
   83   124        BOOL_NOT                                         ~63     !13
        125      > JMPZ_EX                                          ~63     ~63, ->130
        126    >   INIT_FCALL                                               'function_exists'
        127        SEND_VAL                                                 '_doing_it_wrong'
        128        DO_ICALL                                         $64     
        129        BOOL                                             ~63     $64
        130    > > JMPZ                                                     ~63, ->132
   84   131    >   ASSIGN                                                   !13, <true>
   87   132    >   TYPE_CHECK                                    2  ~66     !12
        133      > JMPZ_EX                                          ~66     ~66, ->137
        134    >   FETCH_DIM_R                                      ~67     !1, 'nullable'
        135        BOOL_NOT                                         ~68     ~67
        136        BOOL                                             ~66     ~68
        137    > > JMPZ                                                     ~66, ->160
   88   138    > > JMPZ                                                     !13, ->147
   89   139    >   INIT_FCALL                                               '_doing_it_wrong'
   90   140        SEND_VAL                                                 'apply_filters_typesafe'
   91   141        ROPE_INIT                                     3  ~70     'Filters+for+'
        142        ROPE_ADD                                      1  ~70     ~70, !0
        143        ROPE_END                                      2  ~69     ~70, '+where+not+expected+to+return+null.'
        144        SEND_VAL                                                 ~69
   92   145        SEND_VAL                                                 '5.6'
   89   146        DO_FCALL                                      0          
   96   147    >   FETCH_R                      global              ~73     !0
        148      > JMPZ                                                     ~73, ->158
   97   149    >   INIT_FCALL_BY_NAME                                       'apply_filters_typesafe'
        150        SEND_VAR_EX                                              !0
        151        SEND_VAR_EX                                              !1
        152        SEND_VAR_EX                                              !9
        153        SEND_UNPACK                                              !3
        154        CHECK_UNDEF_ARGS                                         
        155        DO_FCALL                                      1  $74     
        156        QM_ASSIGN                                        ~75     $74
        157      > JMP                                                      ->159
   98   158    >   QM_ASSIGN                                        ~75     !12
        159    > > RETURN                                                   ~75
  101   160    >   BIND_STATIC                                              !14
  102   161        BOOL_NOT                                         ~76     !14
        162      > JMPZ                                                     ~76, ->164
  103   163    >   ASSIGN                                                   !14, <array>
  121   164    >   FETCH_DIM_R                                      ~78     !1, 'accepted_types'
        165      > FE_RESET_R                                       $79     ~78, ->214
        166    > > FE_FETCH_R                                               $79, !4, ->214
  122   167    >   ISSET_ISEMPTY_DIM_OBJ                         0  ~80     !14, !4
        168      > JMPZ_EX                                          ~80     ~80, ->174
        169    >   FETCH_DIM_R                                      ~81     !14, !4
        170        INIT_USER_CALL                                1          'call_user_func', ~81
        171        SEND_USER                                                !12
        172        DO_FCALL                                      0  $82     
        173        BOOL                                             ~80     $82
        174    > > JMPZ                                                     ~80, ->189
  123   175    >   FETCH_R                      global              ~83     !0
        176      > JMPZ                                                     ~83, ->186
  124   177    >   INIT_FCALL_BY_NAME                                       'apply_filters_typesafe'
        178        SEND_VAR_EX                                              !0
        179        SEND_VAR_EX                                              !1
        180        SEND_VAR_EX                                              !12
        181        SEND_UNPACK                                              !3
        182        CHECK_UNDEF_ARGS                                         
        183        DO_FCALL                                      1  $84     
        184        QM_ASSIGN                                        ~85     $84
        185      > JMP                                                      ->187
  125   186    >   QM_ASSIGN                                        ~85     !12
        187    >   FE_FREE                                                  $79
        188      > RETURN                                                   ~85
  128   189    > > JMPZ_EX                                          ~86     !5, ->192
        190    >   TYPE_CHECK                                   64  ~87     !4
        191        BOOL                                             ~86     ~87
        192    > > JMPZ_EX                                          ~86     ~86, ->198
        193    >   INIT_FCALL                                               'is_a'
        194        SEND_VAR                                                 !12
        195        SEND_VAR                                                 !4
        196        DO_ICALL                                         $88     
        197        BOOL                                             ~86     $88
        198    > > JMPZ                                                     ~86, ->213
  129   199    >   FETCH_R                      global              ~89     !0
        200      > JMPZ                                                     ~89, ->210
  130   201    >   INIT_FCALL_BY_NAME                                       'apply_filters_typesafe'
        202        SEND_VAR_EX                                              !0
        203        SEND_VAR_EX                                              !1
        204        SEND_VAR_EX                                              !12
        205        SEND_UNPACK                                              !3
        206        CHECK_UNDEF_ARGS                                         
        207        DO_FCALL                                      1  $90     
        208        QM_ASSIGN                                        ~91     $90
        209      > JMP                                                      ->211
  131   210    >   QM_ASSIGN                                        ~91     !12
        211    >   FE_FREE                                                  $79
        212      > RETURN                                                   ~91
  121   213    > > JMP                                                      ->166
        214    >   FE_FREE                                                  $79
  135   215      > JMPZ                                                     !13, ->243
  136   216    >   INIT_FCALL                                               'implode'
        217        SEND_VAL                                                 '%2C+'
        218        FETCH_DIM_R                                      ~92     !1, 'accepted_types'
        219        SEND_VAL                                                 ~92
        220        DO_ICALL                                         $93     
        221        ASSIGN                                                   !15, $93
  137   222        TYPE_CHECK                                  256          !12
        223      > JMPZ                                                     ~95, ->228
        224    >   GET_CLASS                                        ~96     !12
        225        CONCAT                                           ~97     'instance+of+', ~96
        226        

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.17 ms | 1050 KiB | 26 Q