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, 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}
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}
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}
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}
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}
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}
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}
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 = 91, Position 2 = 104
Branch analysis from position: 91
2 jumps found. (Code = 43) Position 1 = 93, Position 2 = 102
Branch analysis from position: 93
1 jumps found. (Code = 42) Position 1 = 103
Branch analysis from position: 103
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 102
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 104
2 jumps found. (Code = 46) Position 1 = 107, Position 2 = 111
Branch analysis from position: 107
2 jumps found. (Code = 43) Position 1 = 112, Position 2 = 113
Branch analysis from position: 112
2 jumps found. (Code = 43) Position 1 = 115, Position 2 = 141
Branch analysis from position: 115
2 jumps found. (Code = 43) Position 1 = 118, Position 2 = 128
Branch analysis from position: 118
2 jumps found. (Code = 43) Position 1 = 120, Position 2 = 128
Branch analysis from position: 120
2 jumps found. (Code = 43) Position 1 = 130, Position 2 = 139
Branch analysis from position: 130
1 jumps found. (Code = 42) Position 1 = 140
Branch analysis from position: 140
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 139
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 128
Branch analysis from position: 128
Branch analysis from position: 141
2 jumps found. (Code = 43) Position 1 = 144, Position 2 = 145
Branch analysis from position: 144
2 jumps found. (Code = 77) Position 1 = 148, Position 2 = 196
Branch analysis from position: 148
2 jumps found. (Code = 78) Position 1 = 149, Position 2 = 196
Branch analysis from position: 149
2 jumps found. (Code = 46) Position 1 = 151, Position 2 = 156
Branch analysis from position: 151
2 jumps found. (Code = 43) Position 1 = 157, Position 2 = 171
Branch analysis from position: 157
2 jumps found. (Code = 43) Position 1 = 159, Position 2 = 168
Branch analysis from position: 159
1 jumps found. (Code = 42) Position 1 = 169
Branch analysis from position: 169
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 168
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 171
2 jumps found. (Code = 46) Position 1 = 172, Position 2 = 174
Branch analysis from position: 172
2 jumps found. (Code = 46) Position 1 = 175, Position 2 = 180
Branch analysis from position: 175
2 jumps found. (Code = 43) Position 1 = 181, Position 2 = 195
Branch analysis from position: 181
2 jumps found. (Code = 43) Position 1 = 183, Position 2 = 192
Branch analysis from position: 183
1 jumps found. (Code = 42) Position 1 = 193
Branch analysis from position: 193
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 192
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 195
1 jumps found. (Code = 42) Position 1 = 148
Branch analysis from position: 148
Branch analysis from position: 180
Branch analysis from position: 174
Branch analysis from position: 156
Branch analysis from position: 196
2 jumps found. (Code = 43) Position 1 = 198, Position 2 = 225
Branch analysis from position: 198
2 jumps found. (Code = 43) Position 1 = 206, Position 2 = 210
Branch analysis from position: 206
1 jumps found. (Code = 42) Position 1 = 212
Branch analysis from position: 212
2 jumps found. (Code = 43) Position 1 = 227, Position 2 = 236
Branch analysis from position: 227
1 jumps found. (Code = 42) Position 1 = 237
Branch analysis from position: 237
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 236
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 210
2 jumps found. (Code = 43) Position 1 = 227, Position 2 = 236
Branch analysis from position: 227
Branch analysis from position: 236
Branch analysis from position: 225
Branch analysis from position: 196
Branch analysis from position: 145
Branch analysis from position: 113
Branch analysis from position: 111
Branch analysis from position: 71
2 jumps found. (Code = 43) Position 1 = 91, Position 2 = 104
Branch analysis from position: 91
Branch analysis from position: 104
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:  239
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        INIT_FCALL                                               'in_array'
         85        SEND_VAL                                                 'mixed'
         86        FETCH_DIM_R                                      ~61     !1, 'accepted_types'
         87        CAST                                          7  ~62     ~61
         88        SEND_VAL                                                 ~62
         89        DO_ICALL                                         $63     
         90      > JMPZ                                                     $63, ->104
   78    91    >   FETCH_R                      global              ~64     !0
         92      > JMPZ                                                     ~64, ->102
   79    93    >   INIT_FCALL_BY_NAME                                       'apply_filters_typesafe'
         94        SEND_VAR_EX                                              !0
         95        SEND_VAR_EX                                              !1
         96        SEND_VAR_EX                                              !14
         97        SEND_UNPACK                                              !3
         98        CHECK_UNDEF_ARGS                                         
         99        DO_FCALL                                      1  $65     
        100        QM_ASSIGN                                        ~66     $65
        101      > JMP                                                      ->103
   80   102    >   QM_ASSIGN                                        ~66     !14
        103    > > RETURN                                                   ~66
   83   104    >   BIND_STATIC                                              !15
   84   105        BOOL_NOT                                         ~67     !15
        106      > JMPZ_EX                                          ~67     ~67, ->111
        107    >   INIT_FCALL                                               'function_exists'
        108        SEND_VAL                                                 '_doing_it_wrong'
        109        DO_ICALL                                         $68     
        110        BOOL                                             ~67     $68
        111    > > JMPZ                                                     ~67, ->113
   85   112    >   ASSIGN                                                   !15, <true>
   88   113    >   TYPE_CHECK                                    2          !14
        114      > JMPZ                                                     ~70, ->141
   89   115    >   FETCH_DIM_R                                      ~71     !1, 'nullable'
        116        BOOL_NOT                                         ~72     ~71
        117      > JMPZ                                                     ~72, ->128
   90   118    >   ASSIGN                                                   !14, !11
   92   119      > JMPZ                                                     !15, ->128
   93   120    >   INIT_FCALL                                               '_doing_it_wrong'
   94   121        SEND_VAL                                                 'apply_filters_typesafe'
   95   122        ROPE_INIT                                     3  ~75     'Filters+for+%27'
        123        ROPE_ADD                                      1  ~75     ~75, !0
        124        ROPE_END                                      2  ~74     ~75, '%27+where+not+expected+to+return+null.'
        125        SEND_VAL                                                 ~74
   96   126        SEND_VAL                                                 '5.6'
   93   127        DO_FCALL                                      0          
  101   128    >   FETCH_R                      global              ~78     !0
        129      > JMPZ                                                     ~78, ->139
  102   130    >   INIT_FCALL_BY_NAME                                       'apply_filters_typesafe'
        131        SEND_VAR_EX                                              !0
        132        SEND_VAR_EX                                              !1
        133        SEND_VAR_EX                                              !14
        134        SEND_UNPACK                                              !3
        135        CHECK_UNDEF_ARGS                                         
        136        DO_FCALL                                      1  $79     
        137        QM_ASSIGN                                        ~80     $79
        138      > JMP                                                      ->140
  103   139    >   QM_ASSIGN                                        ~80     !14
        140    > > RETURN                                                   ~80
  106   141    >   BIND_STATIC                                              !16
  107   142        BOOL_NOT                                         ~81     !16
        143      > JMPZ                                                     ~81, ->145
  108   144    >   ASSIGN                                                   !16, <array>
  127   145    >   FETCH_DIM_R                                      ~83     !1, 'accepted_types'
        146        CAST                                          7  ~84     ~83
        147      > FE_RESET_R                                       $85     ~84, ->196
        148    > > FE_FETCH_R                                               $85, !5, ->196
  128   149    >   ISSET_ISEMPTY_DIM_OBJ                         0  ~86     !16, !5
        150      > JMPZ_EX                                          ~86     ~86, ->156
        151    >   FETCH_DIM_R                                      ~87     !16, !5
        152        INIT_USER_CALL                                1          'call_user_func', ~87
        153        SEND_USER                                                !14
        154        DO_FCALL                                      0  $88     
        155        BOOL                                             ~86     $88
        156    > > JMPZ                                                     ~86, ->171
  129   157    >   FETCH_R                      global              ~89     !0
        158      > JMPZ                                                     ~89, ->168
  130   159    >   INIT_FCALL_BY_NAME                                       'apply_filters_typesafe'
        160        SEND_VAR_EX                                              !0
        161        SEND_VAR_EX                                              !1
        162        SEND_VAR_EX                                              !14
        163        SEND_UNPACK                                              !3
        164        CHECK_UNDEF_ARGS                                         
        165        DO_FCALL                                      1  $90     
        166        QM_ASSIGN                                        ~91     $90
        167      > JMP                                                      ->169
  131   168    >   QM_ASSIGN                                        ~91     !14
        169    >   FE_FREE                                                  $85
        170      > RETURN                                                   ~91
  134   171    > > JMPZ_EX                                          ~92     !6, ->174
        172    >   TYPE_CHECK                      

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.2 ms | 1502 KiB | 30 Q