3v4l.org

run code in 500+ PHP versions simultaneously
<?php /** * Add the core functions. */ function apply_filters( $hook_name, $value ) { return $value; } function wp_parse_str( $string, &$array ) { parse_str( $string, $array ); /** * Filters the array of variables derived from a parsed string. * * @since 2.3.0 * * @param array $array The array populated with variables. */ $array = apply_filters( 'wp_parse_str', $array ); } function wp_parse_args( $args, $defaults = array() ) { if ( is_object( $args ) ) { $parsed_args = get_object_vars( $args ); } elseif ( is_array( $args ) ) { $parsed_args =& $args; } else { wp_parse_str( $args, $parsed_args ); } if ( is_array( $defaults ) && $defaults ) { return array_merge( $defaults, $parsed_args ); } return $parsed_args; } /** * Run the sample code to validate what happens when $args is null. */ $args = null; $defaults = array( 'foo' => 'bar' ); $args = wp_parse_args( $args, $defaults ); var_dump( $args ); // array(1) { ["foo"]=> string(3) "bar" }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/P9tVH
function name:  (null)
number of ops:  11
compiled vars:  !0 = $args, !1 = $defaults
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   43     0  E >   ASSIGN                                                       !0, null
   44     1        ASSIGN                                                       !1, <array>
   45     2        INIT_FCALL                                                   'wp_parse_args'
          3        SEND_VAR                                                     !0
          4        SEND_VAR                                                     !1
          5        DO_FCALL                                          0  $4      
          6        ASSIGN                                                       !0, $4
   47     7        INIT_FCALL                                                   'var_dump'
          8        SEND_VAR                                                     !0
          9        DO_ICALL                                                     
         10      > RETURN                                                       1

Function apply_filters:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/P9tVH
function name:  apply_filters
number of ops:  4
compiled vars:  !0 = $hook_name, !1 = $value
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    7     0  E >   RECV                                                 !0      
          1        RECV                                                 !1      
    8     2      > RETURN                                                       !1
    9     3*     > RETURN                                                       null

End of function apply_filters

Function wp_parse_str:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/P9tVH
function name:  wp_parse_str
number of ops:  12
compiled vars:  !0 = $string, !1 = $array
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   11     0  E >   RECV                                                 !0      
          1        RECV                                                 !1      
   12     2        INIT_FCALL                                                   'parse_str'
          3        SEND_VAR                                                     !0
          4        SEND_REF                                                     !1
          5        DO_ICALL                                                     
   21     6        INIT_FCALL                                                   'apply_filters'
          7        SEND_VAL                                                     'wp_parse_str'
          8        SEND_VAR                                                     !1
          9        DO_FCALL                                          0  $3      
         10        ASSIGN                                                       !1, $3
   22    11      > RETURN                                                       null

End of function wp_parse_str

Function wp_parse_args:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 9
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
2 jumps found. (Code = 46) Position 1 = 19, Position 2 = 20
Branch analysis from position: 19
2 jumps found. (Code = 43) Position 1 = 21, Position 2 = 26
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 26
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 20
Branch analysis from position: 9
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 13
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
Branch analysis from position: 13
2 jumps found. (Code = 46) Position 1 = 19, Position 2 = 20
Branch analysis from position: 19
Branch analysis from position: 20
filename:       /in/P9tVH
function name:  wp_parse_args
number of ops:  28
compiled vars:  !0 = $args, !1 = $defaults, !2 = $parsed_args
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   24     0  E >   RECV                                                 !0      
          1        RECV_INIT                                            !1      <array>
   25     2        TYPE_CHECK                                      256          !0
          3      > JMPZ                                                         ~3, ->9
   26     4    >   INIT_FCALL                                                   'get_object_vars'
          5        SEND_VAR                                                     !0
          6        DO_ICALL                                             $4      
          7        ASSIGN                                                       !2, $4
   25     8      > JMP                                                          ->17
   27     9    >   TYPE_CHECK                                      128          !0
         10      > JMPZ                                                         ~6, ->13
   28    11    >   ASSIGN_REF                                                   !2, !0
   27    12      > JMP                                                          ->17
   30    13    >   INIT_FCALL                                                   'wp_parse_str'
         14        SEND_VAR                                                     !0
         15        SEND_REF                                                     !2
         16        DO_FCALL                                          0          
   33    17    >   TYPE_CHECK                                      128  ~9      !1
         18      > JMPZ_EX                                              ~9      ~9, ->20
         19    >   BOOL                                                 ~9      !1
         20    > > JMPZ                                                         ~9, ->26
   34    21    >   INIT_FCALL                                                   'array_merge'
         22        SEND_VAR                                                     !1
         23        SEND_VAR                                                     !2
         24        DO_ICALL                                             $10     
         25      > RETURN                                                       $10
   36    26    > > RETURN                                                       !2
   37    27*     > RETURN                                                       null

End of function wp_parse_args

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
168.55 ms | 1995 KiB | 20 Q