3v4l.org

run code in 300+ PHP versions simultaneously
<?php class My{ function prepare($text){ return $this->rand(explode('|', '\\1')); } private function rand(array $values){ return $values[rand(0, sizeof($values)-1)]; } } echo (new My)->prepare('i choose {ps3|games}');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1ll5Z
function name:  (null)
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   NEW                                              $0      'My'
          1        DO_FCALL                                      0          
          2        INIT_METHOD_CALL                                         $0, 'prepare'
          3        SEND_VAL_EX                                              'i+choose+%7Bps3%7Cgames%7D'
          4        DO_FCALL                                      0  $2      
          5        ECHO                                                     $2
          6      > RETURN                                                   1

Class My:
Function prepare:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1ll5Z
function name:  prepare
number of ops:  10
compiled vars:  !0 = $text
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    5     1        INIT_METHOD_CALL                                         'rand'
          2        INIT_FCALL                                               'explode'
          3        SEND_VAL                                                 '%7C'
          4        SEND_VAL                                                 '%5C1'
          5        DO_ICALL                                         $1      
          6        SEND_VAR_NO_REF_EX                                       $1
          7        DO_FCALL                                      0  $2      
          8      > RETURN                                                   $2
    7     9*     > RETURN                                                   null

End of function prepare

Function rand:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1ll5Z
function name:  rand
number of ops:  10
compiled vars:  !0 = $values
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
    9     1        INIT_FCALL                                               'rand'
          2        SEND_VAL                                                 0
          3        COUNT                                            ~1      !0
          4        SUB                                              ~2      ~1, 1
          5        SEND_VAL                                                 ~2
          6        DO_ICALL                                         $3      
          7        FETCH_DIM_R                                      ~4      !0, $3
          8      > RETURN                                                   ~4
   10     9*     > RETURN                                                   null

End of function rand

End of class My.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.95 ms | 1396 KiB | 17 Q