3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Gengi { function __construct($currency=null) { $this->url = "http://api02.gengi.is/currency/"; if ( !is_null( $currency ) ): $this->url .= $currency; endif; $this->curr = $currency; } public function request() { $result = file_get_contents($this->url); var_dump(json_decode($result,true)); } } $orig = "{query}"; $gengi = new Gengi($orig); $json = $gengi->request();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/7NQDi
function name:  (null)
number of ops:  9
compiled vars:  !0 = $orig, !1 = $gengi, !2 = $json
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   ASSIGN                                                   !0, '%7Bquery%7D'
   21     1        NEW                                              $4      'Gengi'
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !1, $4
   22     5        INIT_METHOD_CALL                                         !1, 'request'
          6        DO_FCALL                                      0  $7      
          7        ASSIGN                                                   !2, $7
          8      > RETURN                                                   1

Class Gengi:
Function __construct:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 8
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
filename:       /in/7NQDi
function name:  __construct
number of ops:  11
compiled vars:  !0 = $currency
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV_INIT                                        !0      null
    5     1        ASSIGN_OBJ                                               'url'
          2        OP_DATA                                                  'http%3A%2F%2Fapi02.gengi.is%2Fcurrency%2F'
    7     3        TYPE_CHECK                                    2  ~2      !0
          4        BOOL_NOT                                         ~3      ~2
          5      > JMPZ                                                     ~3, ->8
    8     6    >   ASSIGN_OBJ_OP                                 8          'url'
          7        OP_DATA                                                  !0
   10     8    >   ASSIGN_OBJ                                               'curr'
          9        OP_DATA                                                  !0
   11    10      > RETURN                                                   null

End of function __construct

Function request:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/7NQDi
function name:  request
number of ops:  13
compiled vars:  !0 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   INIT_FCALL                                               'file_get_contents'
          1        FETCH_OBJ_R                                      ~1      'url'
          2        SEND_VAL                                                 ~1
          3        DO_ICALL                                         $2      
          4        ASSIGN                                                   !0, $2
   16     5        INIT_FCALL                                               'var_dump'
          6        INIT_FCALL                                               'json_decode'
          7        SEND_VAR                                                 !0
          8        SEND_VAL                                                 <true>
          9        DO_ICALL                                         $4      
         10        SEND_VAR                                                 $4
         11        DO_ICALL                                                 
   17    12      > RETURN                                                   null

End of function request

End of class Gengi.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
164.73 ms | 1400 KiB | 19 Q