3v4l.org

run code in 300+ PHP versions simultaneously
<?php class MyClass { private $pdo; private static $instance; private function __construct() { } public static function getInstance() { if (null === self::$instance) { $self::$instance = new self(); } return self::$Instance; } /** * Just an example method to show * how to interact with the PDO instance */ public function queryAndFetch($query) { $stmt = $this->pdo->query($query); return $stmt->fetchAll(PDO::FETCH_ASSOC); } }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/raZaI
function name:  (null)
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   31     0  E > > RETURN                                                   1

Class MyClass:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/raZaI
function name:  __construct
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E > > RETURN                                                   null

End of function __construct

Function getinstance:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 8
Branch analysis from position: 3
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
filename:       /in/raZaI
function name:  getInstance
number of ops:  11
compiled vars:  !0 = $self
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   FETCH_STATIC_PROP_R          unknown             ~1      'instance'
          1        TYPE_CHECK                                    2          ~1
          2      > JMPZ                                                     ~2, ->8
   17     3    >   FETCH_CLASS                                   0  $3      !0
          4        NEW                          self                $5      
          5        DO_FCALL                                      0          
          6        ASSIGN_STATIC_PROP                                       'instance', $3
          7        OP_DATA                                                  $5
   19     8    >   FETCH_STATIC_PROP_R          unknown             ~7      'Instance'
          9      > RETURN                                                   ~7
   20    10*     > RETURN                                                   null

End of function getinstance

Function queryandfetch:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/raZaI
function name:  queryAndFetch
number of ops:  11
compiled vars:  !0 = $query, !1 = $stmt
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   26     0  E >   RECV                                             !0      
   28     1        FETCH_OBJ_R                                      ~2      'pdo'
          2        INIT_METHOD_CALL                                         ~2, 'query'
          3        SEND_VAR_EX                                              !0
          4        DO_FCALL                                      0  $3      
          5        ASSIGN                                                   !1, $3
   29     6        INIT_METHOD_CALL                                         !1, 'fetchAll'
          7        SEND_VAL_EX                                              2
          8        DO_FCALL                                      0  $5      
          9      > RETURN                                                   $5
   30    10*     > RETURN                                                   null

End of function queryandfetch

End of class MyClass.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.24 ms | 1395 KiB | 13 Q