3v4l.org

run code in 500+ PHP versions simultaneously
<?php // Mocking WordPress function add_filter(string $tag, callable $value) { $GLOBALS[$tag][] = $value; } function _doing_it_wrong($fn, string $message, string $ver) { echo "\n--------------\nDOING IT WRONG: $message\n--------------\n"; } // ------------------------------------------------------------------ function apply_filters_typesafe( $tag, $arguments = array(), $value = null, ...$values ) { if ( empty( $GLOBALS[$tag] ) ) { return $value; } static $types_map; if (!$types_map) { $types_map = [ 'boolean' => 'boolean', 'integer' => 'numeric', 'double' => 'numeric', 'string' => 'string', 'array' => 'array', 'resource' => 'resource', 'resource (closed)' => 'resource', 'NULL' => 'mixed', ]; } $type = gettype( $value ); $is_object = is_object( $value ); $accepted_types = isset( $types_map[ $type ] ) ? array( $types_map[ $type ] ) : array(); // Do not calculate multiple times for same class. static $classes_types = []; // Skip calculation of accepted types if they are are explicitly passed. if ( $is_object && empty ( $arguments['accepted_types'] ) ) { $class = get_class( $value ); if ( isset( $classes_types[ $class ] ) ) { $accepted_types = $classes_types[ $class ]; } else { $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 ) ); } $classes_types[ $class ] = $accepted_types; } $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( $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 ) { if ( !$arguments['nullable'] ) { $filtered = $original; 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, $filtered, ...$values ) : $filtered; } static $functions; if ( ! $functions ) { $functions = array( 'int' => 'is_int', '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 ( (array)$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 ) : $original; } // 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(); echo "\n----------------------\n"; // Now, let's try with more filters and nullable. add_filter('answer', function () { return null; }); add_filter('answer', function (int $previous = null) { return $previous ?? 21; }); add_filter('answer', function (int $previous = null) { return ':troll:'; }); add_filter('answer', function (int $previous = null) { return $previous === null ? null : $previous * 2; }); $answer = apply_filters_typesafe('answer', ['accepted_types' => ['int'], 'nullable' => true], 0); printf('The answer is: %d.', $answer);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/pbMST
function name:  (null)
number of ops:  51
compiled vars:  !0 = $callable, !1 = $answer
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
  159     0  E >   INIT_FCALL                                                   'add_filter'
          1        SEND_VAL                                                     'hello'
          2        DECLARE_LAMBDA_FUNCTION                              ~2      [0]
  161     3        SEND_VAL                                                     ~2
  159     4        DO_FCALL                                          0          
  163     5        INIT_FCALL                                                   'add_filter'
          6        SEND_VAL                                                     'hello'
          7        DECLARE_LAMBDA_FUNCTION                              ~4      [1]
  167     8        SEND_VAL                                                     ~4
  163     9        DO_FCALL                                          0          
  171    10        INIT_FCALL                                                   'apply_filters_typesafe'
         11        SEND_VAL                                                     'hello'
         12        SEND_VAL                                                     <array>
         13        SEND_VAL                                                     '__return_empty_string'
         14        DO_FCALL                                          0  $6      
         15        ASSIGN                                                       !0, $6
  172    16        INIT_DYNAMIC_CALL                                            !0
         17        DO_FCALL                                          0  $8      
         18        ECHO                                                         $8
  174    19        ECHO                                                         '%0A----------------------%0A'
  179    20        INIT_FCALL                                                   'add_filter'
         21        SEND_VAL                                                     'answer'
         22        DECLARE_LAMBDA_FUNCTION                              ~9      [2]
  181    23        SEND_VAL                                                     ~9
  179    24        DO_FCALL                                          0          
  183    25        INIT_FCALL                                                   'add_filter'
         26        SEND_VAL                                                     'answer'
         27        DECLARE_LAMBDA_FUNCTION                              ~11     [3]
  185    28        SEND_VAL                                                     ~11
  183    29        DO_FCALL                                          0          
  187    30        INIT_FCALL                                                   'add_filter'
         31        SEND_VAL                                                     'answer'
         32        DECLARE_LAMBDA_FUNCTION                              ~13     [4]
  189    33        SEND_VAL                                                     ~13
  187    34        DO_FCALL                                          0          
  191    35        INIT_FCALL                                                   'add_filter'
         36        SEND_VAL                                                     'answer'
         37        DECLARE_LAMBDA_FUNCTION                              ~15     [5]
  193    38        SEND_VAL                                                     ~15
  191    39        DO_FCALL                                          0          
  195    40        INIT_FCALL                                                   'apply_filters_typesafe'
         41        SEND_VAL                                                     'answer'
         42        SEND_VAL                                                     <array>
         43        SEND_VAL                                                     0
         44        DO_FCALL                                          0  $17     
         45        ASSIGN                                                       !1, $17
  196    46        INIT_FCALL                                                   'printf'
         47        SEND_VAL                                                     'The+answer+is%3A+%25d.'
         48        SEND_VAR                                                     !1
         49        DO_ICALL                                                     
         50      > 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/pbMST
function name:  {closure:/in/pbMST:159}
number of ops:  2
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
  160     0  E > > RETURN                                                       'This+is+not+a+callable'
  161     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/pbMST
function name:  {closure:/in/pbMST:163}
number of ops:  3
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
  164     0  E >   DECLARE_LAMBDA_FUNCTION                              ~0      [0]
  166     1      > RETURN                                                       ~0
  167     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/pbMST
function name:  {closure:{closure:/in/pbMST:163}:164}
number of ops:  2
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
  165     0  E > > RETURN                                                       'It+works%21'
  166     1*     > RETURN                                                       null

End of Dynamic Function 0

End of Dynamic Function 1

Dynamic Function 2
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/pbMST
function name:  {closure:/in/pbMST:179}
number of ops:  2
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
  180     0  E > > RETURN                                                       null
  181     1*     > RETURN                                                       null

End of Dynamic Function 2

Dynamic Function 3
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/pbMST
function name:  {closure:/in/pbMST:183}
number of ops:  5
compiled vars:  !0 = $previous
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
  183     0  E >   RECV_INIT                                            !0      null
  184     1        COALESCE                                             ~1      !0
          2        QM_ASSIGN                                            ~1      21
          3      > RETURN                                                       ~1
  185     4*     > RETURN                                                       null

End of Dynamic Function 3

Dynamic Function 4
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/pbMST
function name:  {closure:/in/pbMST:187}
number of ops:  3
compiled vars:  !0 = $previous
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
  187     0  E >   RECV_INIT                                            !0      null
  188     1      > RETURN                                                       '%3Atroll%3A'
  189     2*     > RETURN                                                       null

End of Dynamic Function 4

Dynamic Function 5
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 5
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/pbMST
function name:  {closure:/in/pbMST:191}
number of ops:  9
compiled vars:  !0 = $previous
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
  191     0  E >   RECV_INIT                                            !0      null
  192     1        TYPE_CHECK                                        2          !0
          2      > JMPZ                                                         ~1, ->5
          3    >   QM_ASSIGN                                            ~2      null
          4      > JMP                                                          ->7
          5    >   MUL                                                  ~3      !0, 2
          6        QM_ASSIGN                                            ~2      ~3
          7    > > RETURN                                                       ~2
  193     8*     > RETURN                                                       null

End of Dynamic Function 5

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

End of function _doing_it_wrong

Function apply_filters_typesafe:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 7
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 11
Branch analysis from position: 10
2 jumps found. (Code = 43) Position 1 = 17, Position 2 = 21
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 22
Branch analysis from position: 22
2 jumps found. (Code = 46) Position 1 = 25, Position 2 = 27
Branch analysis from position: 25
2 jumps found. (Code = 43) Position 1 = 28, Position 2 = 59
Branch analysis from position: 28
2 jumps found. (Code = 43) Position 1 = 32, Position 2 = 35
Branch analysis from position: 32
1 jumps found. (Code = 42) Position 1 = 57
Branch analysis from position: 57
2 jumps found. (Code = 43) Position 1 = 68, Position 2 = 71
Branch analysis from position: 68
1 jumps found. (Code = 42) Position 1 = 72
Branch analysis from position: 72
2 jumps found. (Code = 43) Position 1 = 88, Position 2 = 101
Branch analysis from position: 88
2 jumps found. (Code = 43) Position 1 = 90, Position 2 = 99
Branch analysis from position: 90
1 jumps found. (Code = 42) Position 1 = 100
Branch analysis from position: 100
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 99
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 101
2 jumps found. (Code = 46) Position 1 = 104, Position 2 = 108
Branch analysis from position: 104
2 jumps found. (Code = 43) Position 1 = 109, Position 2 = 110
Branch analysis from position: 109
2 jumps found. (Code = 43) Position 1 = 112, Position 2 = 138
Branch analysis from position: 112
2 jumps found. (Code = 43) Position 1 = 115, Position 2 = 125
Branch analysis from position: 115
2 jumps found. (Code = 43) Position 1 = 117, Position 2 = 125
Branch analysis from position: 117
2 jumps found. (Code = 43) Position 1 = 127, Position 2 = 136
Branch analysis from position: 127
1 jumps found. (Code = 42) Position 1 = 137
Branch analysis from position: 137
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 136
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 125
Branch analysis from position: 125
Branch analysis from position: 138
2 jumps found. (Code = 43) Position 1 = 141, Position 2 = 142
Branch analysis from position: 141
2 jumps found. (Code = 77) Position 1 = 145, Position 2 = 193
Branch analysis from position: 145
2 jumps found. (Code = 78) Position 1 = 146, Position 2 = 193
Branch analysis from position: 146
2 jumps found. (Code = 46) Position 1 = 148, Position 2 = 153
Branch analysis from position: 148
2 jumps found. (Code = 43) Position 1 = 154, Position 2 = 168
Branch analysis from position: 154
2 jumps found. (Code = 43) Position 1 = 156, Position 2 = 165
Branch analysis from position: 156
1 jumps found. (Code = 42) Position 1 = 166
Branch analysis from position: 166
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 165
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 168
2 jumps found. (Code = 46) Position 1 = 169, Position 2 = 171
Branch analysis from position: 169
2 jumps found. (Code = 46) Position 1 = 172, Position 2 = 177
Branch analysis from position: 172
2 jumps found. (Code = 43) Position 1 = 178, Position 2 = 192
Branch analysis from position: 178
2 jumps found. (Code = 43) Position 1 = 180, Position 2 = 189
Branch analysis from position: 180
1 jumps found. (Code = 42) Position 1 = 190
Branch analysis from position: 190
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 189
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 192
1 jumps found. (Code = 42) Position 1 = 145
Branch analysis from position: 145
Branch analysis from position: 177
Branch analysis from position: 171
Branch analysis from position: 153
Branch analysis from position: 193
2 jumps found. (Code = 43) Position 1 = 195, Position 2 = 219
Branch analysis from position: 195
2 jumps found. (Code = 43) Position 1 = 200, Position 2 = 204
Branch analysis from position: 200
1 jumps found. (Code = 42) Position 1 = 206
Branch analysis from position: 206
2 jumps found. (Code = 43) Position 1 = 221, Position 2 = 230
Branch analysis from position: 221
1 jumps found. (Code = 42) Position 1 = 231
Branch analysis from position: 231
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 230
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 204
2 jumps found. (Code = 43) Position 1 = 221, Position 2 = 230
Branch analysis from position: 221
Branch analysis from position: 230
Branch analysis from position: 219
Branch analysis from position: 193
Branch analysis from position: 142
Branch analysis from position: 110
Branch analysis from position: 108
Branch analysis from position: 71
2 jumps found. (Code = 43) Position 1 = 88, Position 2 = 101
Branch analysis from position: 88
Branch analysis from position: 101
Branch analysis from position: 35
1 jumps found. (Code = 42) Position 1 = 48
Branch analysis from position: 48
2 jumps found. (Code = 44) Position 1 = 49, Position 2 = 42
Branch analysis from position: 49
2 jumps found. (Code = 43) Position 1 = 68, Position 2 = 71
Branch analysis from position: 68
Branch analysis from position: 71
Branch analysis from position: 42
2 jumps found. (Code = 44) Position 1 = 49, Position 2 = 42
Branch analysis from position: 49
Branch analysis from position: 42
Branch analysis from position: 59
Branch analysis from position: 27
Branch analysis from position: 21
2 jumps found. (Code = 46) Position 1 = 25, Position 2 = 27
Branch analysis from position: 25
Branch analysis from position: 27
Branch analysis from position: 11
filename:       /in/pbMST
function name:  apply_filters_typesafe
number of ops:  233
compiled vars:  !0 = $tag, !1 = $arguments, !2 = $value, !3 = $values, !4 = $types_map, !5 = $type, !6 = $is_object, !7 = $accepted_types, !8 = $classes_types, !9 = $class, !10 = $parent, !11 = $original, !12 = $to_filter, !13 = $filter, !14 = $filtered, !15 = $can_do_it_wrong, !16 = $functions, !17 = $expected, !18 = $actual
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   14     0  E >   RECV                                                 !0      
          1        RECV_INIT                                            !1      <array>
          2        RECV_INIT                                            !2      null
          3        RECV_VARIADIC                                        !3      
   16     4        ISSET_ISEMPTY_VAR                                 3          !0
          5      > JMPZ                                                         ~19, ->7
   17     6    > > RETURN                                                       !2
   20     7    >   BIND_STATIC                                                  !4
   21     8        BOOL_NOT                                             ~20     !4
          9      > JMPZ                                                         ~20, ->11
   22    10    >   ASSIGN                                                       !4, <array>
   34    11    >   GET_TYPE                                             ~22     !2
         12        ASSIGN                                                       !5, ~22
   35    13        TYPE_CHECK                                      256  ~24     !2
         14        ASSIGN                                                       !6, ~24
   36    15        ISSET_ISEMPTY_DIM_OBJ                             0          !4, !5
         16      > JMPZ                                                         ~26, ->21
         17    >   FETCH_DIM_R                                          ~27     !4, !5
         18        INIT_ARRAY                                           ~28     ~27
         19        QM_ASSIGN                                            ~29     ~28
         20      > JMP                                                          ->22
         21    >   QM_ASSIGN                                            ~29     <array>
         22    >   ASSIGN                                                       !7, ~29
   39    23        BIND_STATIC                                                  !8
   41    24      > JMPZ_EX                                              ~31     !6, ->27
         25    >   ISSET_ISEMPTY_DIM_OBJ                             1  ~32     !1, 'accepted_types'
         26        BOOL                                                 ~31     ~32
         27    > > JMPZ                                                         ~31, ->59
   42    28    >   GET_CLASS                                            ~33     !2
         29        ASSIGN                                                       !9, ~33
   43    30        ISSET_ISEMPTY_DIM_OBJ                             0          !8, !9
         31      > JMPZ                                                         ~35, ->35
   44    32    >   FETCH_DIM_R                                          ~36     !8, !9
         33        ASSIGN                                                       !7, ~36
   43    34      > JMP                                                          ->57
   46    35    >   INIT_ARRAY                                           ~38     !9
         36        ASSIGN                                                       !7, ~38
   47    37        INIT_FCALL                                                   'get_parent_class'
         38        SEND_VAR                                                     !9
         39        DO_ICALL                                             $40     
         40        ASSIGN                                                       !10, $40
   48    41      > JMP                                                          ->48
   49    42    >   ASSIGN_DIM                                                   !7
         43        OP_DATA                                                      !10
   50    44        INIT_FCALL                                                   'get_parent_class'
         45        SEND_VAR                                                     !10
         46        DO_ICALL                                             $43     
         47        ASSIGN                                                       !10, $43
   48    48    > > JMPNZ                                                        !10, ->42
   53    49    >   INIT_FCALL                                                   'array_merge'
         50        SEND_VAR                                                     !7
         51        INIT_FCALL                                                   'class_implements'
         52        SEND_VAR                                                     !9
         53        DO_ICALL                                             $45     
         54        SEND_VAR                                                     $45
         55        DO_ICALL                                             $46     
         56        ASSIGN                                                       !7, $46
   56    57    >   ASSIGN_DIM                                                   !8, !9
         58        OP_DATA                                                      !7
   59    59    >   INIT_FCALL                                                   'array_replace'
   61    60        INIT_ARRAY                                           ~49     <false>, 'nullable'
   62    61        ADD_ARRAY_ELEMENT                                    ~49     !7, 'accepted_types'
         62        SEND_VAL                                                     ~49
   64    63        SEND_VAR                                                     !1
   59    64        DO_ICALL                                             $50     
         65        ASSIGN                                                       !1, $50
   67    66        ASSIGN                                                       !11, !2
   69    67      > JMPZ                                                         !6, ->71
         68    >   CLONE                                                ~53     !2
         69        QM_ASSIGN                                            ~54     ~53
         70      > JMP                                                          ->72
         71    >   QM_ASSIGN                                            ~54     !2
         72    >   ASSIGN                                                       !12, ~54
   71    73        INIT_FCALL                                                   'array_shift'
         74        FETCH_W                          global              $56     !0
         75        SEND_REF                                                     $56
         76        DO_ICALL                                             $57     
         77        ASSIGN                                                       !13, $57
   73    78        INIT_DYNAMIC_CALL                                            !13
         79        SEND_VAR_EX                                                  !12
         80        SEND_UNPACK                                                  !3
         81        CHECK_UNDEF_ARGS                                             
         82        DO_FCALL                                          1  $59     
         83        ASSIGN                                                       !14, $59
   77    84        FETCH_DIM_R                                          ~61     !1, 'accepted_types'
         85        CAST                                              7  ~62     ~61
         86        FRAMELESS_ICALL_2                in_array            ~63     'mixed', ~62
         87      > JMPZ                                                         ~63, ->101
   78    88    >   FETCH_R                          global              ~64     !0
         89      > JMPZ                                                         ~64, ->99
   79    90    >   INIT_FCALL_BY_NAME                                           'apply_filters_typesafe'
         91        SEND_VAR_EX                                                  !0
         92        SEND_VAR_EX                                                  !1
         93        SEND_VAR_EX                                                  !14
         94        SEND_UNPACK                                                  !3
         95        CHECK_UNDEF_ARGS                                             
         96        DO_FCALL                                          1  $65     
         97        QM_ASSIGN                                            ~66     $65
         98      > JMP                                                          ->100
   80    99    >   QM_ASSIGN                                            ~66     !14
        100    > > RETURN                                                       ~66
   83   101    >   BIND_STATIC                                                  !15
   84   102        BOOL_NOT                                             ~67     !15
        103      > JMPZ_EX                                              ~67     ~67, ->108
        104    >   INIT_FCALL                                                   'function_exists'
        105        SEND_VAL                                                     '_doing_it_wrong'
        106        DO_ICALL                                             $68     
        107        BOOL                                                 ~67     $68
        108    > > JMPZ                                                         ~67, ->110
   85   109    >   ASSIGN                                                       !15, <true>
   88   110    >   TYPE_CHECK                                        2          !14
        111      > JMPZ                                                         ~70, ->138
   89   112    >   FETCH_DIM_R                                          ~71     !1, 'nullable'
        113        BOOL_NOT                                             ~72     ~71
        114      > JMPZ                                                         ~72, ->125
   90   115    >   ASSIGN                                                       !14, !11
   92   116      > JMPZ                                                         !15, ->125
   93   117    >   INIT_FCALL                                                   '_doing_it_wrong'
   94   118        SEND_VAL                                                     'apply_filters_typesafe'
   95   119        ROPE_INIT                                         3  ~75     'Filters+for+%27'
        120        ROPE_ADD                                          1  ~75     ~75, !0
        121        ROPE_END                                          2  ~74     ~75, '%27+where+not+expected+to+return+null.'
        122        SEND_VAL                                                     ~74
   96   123        SEND_VAL                                                     '5.6'
   93   124        DO_FCALL                                          0          
  101   125    >   FETCH_R                          global              ~78     !0
        126      > JMPZ                                                         ~78, ->136
  102   127    >   INIT_FCALL_BY_NAME                                           'apply_filters_typesafe'
        128        SEND_VAR_EX                                                  !0
        129        SEND_VAR_EX                                                  !1
        130        SEND_VAR_EX                                                  !14
        131        SEND_UNPACK                                                  !3
        132        CHECK_UNDEF_ARGS                                             
        133        DO_FCALL                                          1  $79     
        134        QM_ASSIGN                                            ~80     $79
        135      > JMP                                                          ->137
  103   136    >   QM_ASSIGN                                            ~80     !14
        137    > > RETURN                                                       ~80
  106   138    >   BIND_STATIC                                                  !16
  107   139        BOOL_NOT                                             ~81     !16
        140      > JMPZ                                                         ~81, ->142
  108   141    >   ASSIGN                                                       !16, <array>
  127   142    >   FETCH_DIM_R                                          ~83     !1, 'accepted_types'
        143        CAST                                              7  ~84     ~83
        144      > FE_RESET_R                                           $85     ~84, ->193
        145    > > FE_FETCH_R                                                   $85, !5, ->193
  128   146    >   ISSET_ISEMPTY_DIM_OBJ                             0  ~86     !16, !5
        147      > JMPZ_EX                                              ~86     ~86, ->153
        148    >   FETCH_DIM_R                                          ~87     !16, !5
        149        INIT_USER_CALL                                    1          'call_user_func', ~87
        150        SEND_USER                                                    !14
        151        DO_FCALL                                          0  $88     
        152        BOOL                                                 ~86     $88
        153    > > JMPZ                                                         ~86, ->168
  129   154    >   FETCH_R                          global              ~89     !0
        155      > JMPZ                                                         ~89, ->165
  130   156    >   INIT_FCALL_BY_NAME                                           'apply_filters_typesafe'
        157        SEND_VAR_EX                                                  !0
     

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
238.93 ms | 3464 KiB | 29 Q