3v4l.org

run code in 300+ PHP versions simultaneously
<?php abstract class Model { /** * Tabela representativa. * @var [array] */ private $_Table; /** * Meta-Descrições dos Campos. * @var [array] */ protected $_Meta; /** * Listagem dos Campos. * @var [array] */ protected $_Fields; /** * Listagem de Campos que não são podem ser Nulos. * @var [array] */ protected $_NotNull; /** * Instância de banco de dados Singleton. * @var [PDO] */ private static $db; /** * Listagem de todas as instâncias. * @var [array][array] */ private static $_Cache; public static function _Instance() { self::$db = new db(); } /** * Define a tabela que será usada no objeto. * @param [string] $table Tabela representativa. */ private function setTable($table) { # Verifica se a entrada é válida. if(empty($table)) throw new Exception("A tabela não pode ser vazia."); # Define a tabela na classe. $this->_Table = $table; } public function Insert() { try { Validate::Run($this); foreach($this->_Fields as $Field) $binds[':' . $Field] = $this->{$Field}; $values = implode(', ', keys($binds)); $fields = $this->_Fields; unset($fields[0]); $fields = implode(', ', $this->_Fields); $query = "INSERT INTO ". $this->_Table ."(". $fields .") VALUES(". $values .")"; self::e($query, $binds); $this->Select(self::$db->lastInsertId()); } catch(Exception $e) { echo $e->getMessage(); return false; } } public function Select($id = NULL) { if(is_null($id)) { $id = $this->{$this->_Fields[0]}; if(is_null($id)) throw new Exception("Impossível realizar select com id nulo da tabela ". $this->_Table ."."); } $fields = implode(', ', $this->_Fields); $query = "SELECT ". $fields ." FROM ". $this->_Table ." WHERE ". $this->_Fields[0] ." = ?"; $stmt = self::e($query , array($id)); $row = $stmt->fetch(PDO::FETCH_ASSOC); if($row) { $this->_ResetFields(); foreach($this->_Fields as $Field) $this->{$Field} = $row[$Field]; # $this->{'Hash'} = Bcrypt::hash($id . $this->_Table); self::$_Cache[$this->_Table][$this->_Fields[0]] = $this; } else throw new Exception("Id ". $id ." não existe na tabela ". $this->_Table); } public function Delete($id = NULL) { if(is_null($id)) { $id = $this->{$this->_Fields[0]}; if(is_null($id)) throw new Exception("Impossível deletar um id nulo da tabela ". $this->_Table ."."); } $query = "SELECT ". $fields ." FROM ". $this->_Table ." WHERE ". $this->_Fields[0] ." = ?"; $stmt = self::e($query , array($id)); if($stmt->fetch()) { if(Db::$VirtualDeletion['on']) { $query = "UPDATE ". $this->_Table ." SET ". Db::$VirtualDeletion['Field'] ." = '". Db::$VirtualDeletion['Value'] ."' WHERE ". $this->_Fields[0] ." = ?"; self::e($query, array($id)); } else { $query = "DELETE FROM ". $this->_Table ." WHERE ". $this->_Fields[0] ." = ?"; self::e($query, array($id)); } return true; } else throw new Exception("O id ". $id ." não pode ser excluído da tabela ". $this->_Table ." pois não existe."); } public function Update($id = NULL) { if(is_null($id)) { $id = $this->{$this->_Fields[0]}; if(is_null($id)) throw new Exception("Impossível realizer update em um id nulo da tabela ". $this->_Table ."."); } Validate::Run($this); foreach($this->_Fields as $Field) $binds[':' . $Field] = $this->{$Field}; $fields = $this->_Fields; unset($fields[0]); foreach($fields as $Field) $values[] = $Field .' = '. $this->{$Field}; $values[] = implode(', ', $values); $query = "UPDATE ". $this->_Table ." SET ". $values ." WHERE ". $this->_Fields[0] ." = :" . $this->_Fields[0]; self::e($query, $binds); unset( self::$_Cache[$this->_Table][$this->_Fields[0]] ); $this->Select($id); } /** * Limpa os objetos da memória cache. */ public static function Clear() { unset(self::$_Cache); } protected static function e($query, $binds) { $_stmt = self::$db->prepare($query); $_stmt->execute($binds); return $_stmt; } protected static function q($query) { return self::$db->query($query); } public function __destruct() { self::$db = null; unset(self::$_Cache); } } /** * Developer: Felipe Francisco * Reference: admin@felipefrancisco.com.br * Date: 10/10/2012 */ class o extends Model { /** * Tipo de saída como HTML. * @var [boolean] */ protected $_HtmlOut = false; /** * Contagem de Atributos reais (previamente declarados) existentes. * @var [int] */ protected $_RealAttrs; /** * Inicia o objeto. * @param [string] $table [Nome da tabela que será carregada em um objeto] * @param [int] $id [Id para ser carregado juntamente, na criação da tabela.] */ function __construct($table, $id = NULL) { # Inicia a instância de banco de dados. if(!Model::db) parent::_Instance(); # Verfica na memória se o objeto já foi iniciado anteriormente. Se sim, retorne-o. if(self::$_Cache[$table][$id] instanceof o) return self::$_Cache[$table][$id]; # Armazena o nome da tabela. $this->setTable($table); # Conta os atributos reais da classe para efeito de cálculo de campos posteriormente. $this->_realAttrs(); # Gera os atributos virtuais; $this->_virtAttrs(); if(!is_null($id)) $this->Select($id); } /** * Valida as saídas da classe, sempre impimindo em formato HTML. * @param [string] $var Representa um atributo virtual da tabela. * @return [mixed] Valor correspondente ao atributo selecionado. */ public function __get($var) { # Verifica se o atributo existe dentro dos atributos virutais. if(in_array($var, $this->_Fields)) { # Caso a saída HTML seja verdadeira, formataremos a variável. if($this->_HtmlOut) return Format::HTML($this->{$var}); else return $this->{$var}; } else throw new Exception("Atributo ". $var ." da tabela ". $this->_Table ." não encontrado."); } /** * Conta os atributos reais da classe para efeito de cálculo de campos posteriormente. */ private function _realAttrs() { # Procura atributos previamente declarados e define a quantidade de atributos previamente declarados na classe. foreach(get_object_vars($this) as $vars) $this->_RealAttrs++; } /** * Define os atributos virtuais da classe. */ private function _virtAttrs() { # Consulta para exibir os campos da tabela em questão. $query = "SHOW COLUMNS FROM ". $this->table; # Execução da Consulta de exibição de campos da tabela. $result = self::q($query); # Caso existam campos na tabela, prossiga: if ($result) { # Enquanto existirem colunas, faça: foreach ($result as $row) { # Cria atributo virtual. $this->{$row['Field']} = null; # Acha a posição que representa o fim do nome do Tipo do Campo. $strpos = strpos($row['Type'],'('); # Define as Meta-características do campo. $this->_Meta[$row['Field']] = ($strpos) ? substr($row['Type'], 0, $strpos) : $row['Type']; # Armazena o campo na lista de Campos. $this->_Fields[] = $row['Field']; if($row['Null'] == 'YES'); $this->_NotNull[] = $row['Field']; } } else throw new Exception("Tabela ". $this->_Table ." não encontrada."); } /** * Reseta a classe. */ private function _ResetAll() { $this->_ResetFields(); $this->HtmlOutput(false); unset( $this->_Table, $this->_RealAttrs, $this->_Meta, $this->_NotNull, $this->_Fields ); } /** * Define o tipo de saída de dados da classe como HTML * @param [boolean] $mode ativa ou desativa a saída HTML */ public function HtmlOutput($mode = true) { # Valida o modo de saída. if(!is_bool($mode)) throw new Exception('Modo de HTML inválido'); # Define a saída de variáveis no modo HTML. $this->_HtmlOut = $mode; } /** * Reseta os campos virtuais. */ protected function _ResetFields() { if(is_array($this->_Fields)) foreach($this->_Fields as $Field) $this->{$Field} = null; else throw new Exception('Não há campos para limpar neste objeto: ' . var_export($this, true)); } } ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vGHhd
function name:  (null)
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  376     0  E > > RETURN                                                   1

Class Model:
Function _instance:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vGHhd
function name:  _Instance
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   43     0  E >   NEW                                              $1      'db'
          1        DO_FCALL                                      0          
          2        ASSIGN_STATIC_PROP                                       'db'
          3        OP_DATA                                                  $1
   44     4      > RETURN                                                   null

End of function _instance

Function settable:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 7
Branch analysis from position: 3
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vGHhd
function name:  setTable
number of ops:  10
compiled vars:  !0 = $table
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   50     0  E >   RECV                                             !0      
   53     1        ISSET_ISEMPTY_CV                                         !0
          2      > JMPZ                                                     ~1, ->7
   54     3    >   NEW                                              $2      'Exception'
          4        SEND_VAL_EX                                              'A+tabela+n%C3%A3o+pode+ser+vazia.'
          5        DO_FCALL                                      0          
          6      > THROW                                         0          $2
   57     7    >   ASSIGN_OBJ                                               '_Table'
          8        OP_DATA                                                  !0
   58     9      > RETURN                                                   null

End of function settable

Function insert:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 6, Position 2 = 12
Branch analysis from position: 6
2 jumps found. (Code = 78) Position 1 = 7, Position 2 = 12
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 54
Branch analysis from position: 54
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
Found catch point at position: 49
Branch analysis from position: 49
2 jumps found. (Code = 107) Position 1 = 50, Position 2 = -2
Branch analysis from position: 50
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vGHhd
function name:  Insert
number of ops:  55
compiled vars:  !0 = $Field, !1 = $binds, !2 = $values, !3 = $fields, !4 = $query, !5 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   64     0  E >   INIT_STATIC_METHOD_CALL                                  'Validate', 'Run'
          1        FETCH_THIS                                       $6      
          2        SEND_VAR_EX                                              $6
          3        DO_FCALL                                      0          
   66     4        FETCH_OBJ_R                                      ~8      '_Fields'
          5      > FE_RESET_R                                       $9      ~8, ->12
          6    > > FE_FETCH_R                                               $9, !0, ->12
   67     7    >   CONCAT                                           ~10     '%3A', !0
          8        FETCH_OBJ_R                                      ~12     !0
          9        ASSIGN_DIM                                               !1, ~10
         10        OP_DATA                                                  ~12
   66    11      > JMP                                                      ->6
         12    >   FE_FREE                                                  $9
   69    13        INIT_FCALL                                               'implode'
         14        SEND_VAL                                                 '%2C+'
         15        INIT_FCALL_BY_NAME                                       'keys'
         16        SEND_VAR_EX                                              !1
         17        DO_FCALL                                      0  $13     
         18        SEND_VAR                                                 $13
         19        DO_ICALL                                         $14     
         20        ASSIGN                                                   !2, $14
   71    21        FETCH_OBJ_R                                      ~16     '_Fields'
         22        ASSIGN                                                   !3, ~16
   72    23        UNSET_DIM                                                !3, 0
   74    24        INIT_FCALL                                               'implode'
         25        SEND_VAL                                                 '%2C+'
         26        FETCH_OBJ_R                                      ~18     '_Fields'
         27        SEND_VAL                                                 ~18
         28        DO_ICALL                                         $19     
         29        ASSIGN                                                   !3, $19
   76    30        FETCH_OBJ_R                                      ~21     '_Table'
         31        CONCAT                                           ~22     'INSERT+INTO+', ~21
         32        CONCAT                                           ~23     ~22, '%28'
         33        CONCAT                                           ~24     ~23, !3
         34        CONCAT                                           ~25     ~24, '%29+VALUES%28'
         35        CONCAT                                           ~26     ~25, !2
         36        CONCAT                                           ~27     ~26, '%29'
         37        ASSIGN                                                   !4, ~27
   78    38        INIT_STATIC_METHOD_CALL                                  'e'
         39        SEND_VAR_EX                                              !4
         40        SEND_VAR_EX                                              !1
         41        DO_FCALL                                      0          
   80    42        INIT_METHOD_CALL                                         'Select'
         43        FETCH_STATIC_PROP_R          unknown             ~30     'db'
         44        INIT_METHOD_CALL                                         ~30, 'lastInsertId'
         45        DO_FCALL                                      0  $31     
         46        SEND_VAR_NO_REF_EX                                       $31
         47        DO_FCALL                                      0          
         48      > JMP                                                      ->54
   82    49  E > > CATCH                                       last         'Exception'
   84    50    >   INIT_METHOD_CALL                                         !5, 'getMessage'
         51        DO_FCALL                                      0  $33     
         52        ECHO                                                     $33
   85    53      > RETURN                                                   <false>
   87    54    > > RETURN                                                   null

End of function insert

Function select:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 16
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 16
Branch analysis from position: 9
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 16
2 jumps found. (Code = 43) Position 1 = 43, Position 2 = 62
Branch analysis from position: 43
2 jumps found. (Code = 77) Position 1 = 47, Position 2 = 52
Branch analysis from position: 47
2 jumps found. (Code = 78) Position 1 = 48, Position 2 = 52
Branch analysis from position: 48
1 jumps found. (Code = 42) Position 1 = 47
Branch analysis from position: 47
Branch analysis from position: 52
1 jumps found. (Code = 42) Position 1 = 70
Branch analysis from position: 70
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 52
Branch analysis from position: 62
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 16
filename:       /in/vGHhd
function name:  Select
number of ops:  71
compiled vars:  !0 = $id, !1 = $fields, !2 = $query, !3 = $stmt, !4 = $row, !5 = $Field
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   89     0  E >   RECV_INIT                                        !0      null
   91     1        TYPE_CHECK                                    2          !0
          2      > JMPZ                                                     ~6, ->16
   92     3    >   FETCH_OBJ_R                                      ~7      '_Fields'
          4        FETCH_DIM_R                                      ~8      ~7, 0
          5        FETCH_OBJ_R                                      ~9      ~8
          6        ASSIGN                                                   !0, ~9
   94     7        TYPE_CHECK                                    2          !0
          8      > JMPZ                                                     ~11, ->16
   95     9    >   NEW                                              $12     'Exception'
         10        FETCH_OBJ_R                                      ~13     '_Table'
         11        CONCAT                                           ~14     'Imposs%C3%ADvel+realizar+select+com+id+nulo+da+tabela+', ~13
         12        CONCAT                                           ~15     ~14, '.'
         13        SEND_VAL_EX                                              ~15
         14        DO_FCALL                                      0          
         15      > THROW                                         0          $12
   98    16    >   INIT_FCALL                                               'implode'
         17        SEND_VAL                                                 '%2C+'
         18        FETCH_OBJ_R                                      ~17     '_Fields'
         19        SEND_VAL                                                 ~17
         20        DO_ICALL                                         $18     
         21        ASSIGN                                                   !1, $18
  100    22        CONCAT                                           ~20     'SELECT+', !1
         23        CONCAT                                           ~21     ~20, '+FROM+'
         24        FETCH_OBJ_R                                      ~22     '_Table'
         25        CONCAT                                           ~23     ~21, ~22
         26        CONCAT                                           ~24     ~23, '+WHERE+'
         27        FETCH_OBJ_R                                      ~25     '_Fields'
         28        FETCH_DIM_R                                      ~26     ~25, 0
         29        CONCAT                                           ~27     ~24, ~26
         30        CONCAT                                           ~28     ~27, '+%3D+%3F'
         31        ASSIGN                                                   !2, ~28
  101    32        INIT_STATIC_METHOD_CALL                                  'e'
         33        SEND_VAR_EX                                              !2
         34        INIT_ARRAY                                       ~30     !0
         35        SEND_VAL_EX                                              ~30
         36        DO_FCALL                                      0  $31     
         37        ASSIGN                                                   !3, $31
  103    38        INIT_METHOD_CALL                                         !3, 'fetch'
         39        SEND_VAL_EX                                              2
         40        DO_FCALL                                      0  $33     
         41        ASSIGN                                                   !4, $33
  105    42      > JMPZ                                                     !4, ->62
  107    43    >   INIT_METHOD_CALL                                         '_ResetFields'
         44        DO_FCALL                                      0          
  109    45        FETCH_OBJ_R                                      ~36     '_Fields'
         46      > FE_RESET_R                                       $37     ~36, ->52
         47    > > FE_FETCH_R                                               $37, !5, ->52
  110    48    >   FETCH_DIM_R                                      ~39     !4, !5
         49        ASSIGN_OBJ                                               !5
         50        OP_DATA                                                  ~39
  109    51      > JMP                                                      ->47
         52    >   FE_FREE                                                  $37
  113    53        FETCH_OBJ_R                                      ~41     '_Table'
         54        FETCH_OBJ_R                                      ~43     '_Fields'
         55        FETCH_DIM_R                                      ~44     ~43, 0
         56        FETCH_THIS                                       ~46     
         57        FETCH_STATIC_PROP_W          unknown             $40     '_Cache'
         58        FETCH_DIM_W                                      $42     $40, ~41
         59        ASSIGN_DIM                                               $42, ~44
         60        OP_DATA                                                  ~46
         61      > JMP                                                      ->70
  116    62    >   NEW                                              $47     'Exception'
         63        CONCAT                                           ~48     'Id+', !0
         64        CONCAT                                           ~49     ~48, '+n%C3%A3o+existe+na+tabela+'
         65        FETCH_OBJ_R                                      ~50     '_Table'
         66        CONCAT                                           ~51     ~49, ~50
         67        SEND_VAL_EX                                              ~51
         68        DO_FCALL                                      0          
         69      > THROW                                         0          $47
  117    70    > > RETURN                                                   null

End of function select

Function delete:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 16
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 16
Branch analysis from position: 9
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 16
2 jumps found. (Code = 43) Position 1 = 35, Position 2 = 75
Branch analysis from position: 35
2 jumps found. (Code = 43) Position 1 = 38, Position 2 = 60
Branch analysis from position: 38
1 jumps found. (Code = 42) Position 1 = 73
Branch analysis from position: 73
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 60
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 75
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 16
filename:       /in/vGHhd
function name:  Delete
number of ops:  85
compiled vars:  !0 = $id, !1 = $query, !2 = $fields, !3 = $stmt
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  119     0  E >   RECV_INIT                                        !0      null
  121     1        TYPE_CHECK                                    2          !0
          2      > JMPZ                                                     ~4, ->16
  122     3    >   FETCH_OBJ_R                                      ~5      '_Fields'
          4        FETCH_DIM_R                                      ~6      ~5, 0
          5        FETCH_OBJ_R                                      ~7      ~6
          6        ASSIGN                                                   !0, ~7
  124     7        TYPE_CHECK                                    2          !0
          8      > JMPZ                                                     ~9, ->16
  125     9    >   NEW                                              $10     'Exception'
         10        FETCH_OBJ_R                                      ~11     '_Table'
         11        CONCAT                                           ~12     'Imposs%C3%ADvel+deletar+um+id+nulo+da+tabela+', ~11
         12        CONCAT                                           ~13     ~12, '.'
         13        SEND_VAL_EX                                              ~13
         14        DO_FCALL                                      0          
         15      > THROW                                         0          $10
  128    16    >   CONCAT                                           ~15     'SELECT+', !2
         17        CONCAT                                           ~16     ~15, '+FROM+'
         18        FETCH_OBJ_R                                      ~17     '_Table'
         19        CONCAT                                           ~18     ~16, ~17
         20        CONCAT                                           ~19     ~18, '+WHERE+'
         21        FETCH_OBJ_R                                      ~20     '_Fields'
         22        FETCH_DIM_R                                      ~21     ~20, 0
         23        CONCAT                                           ~22     ~19, ~21
         24        CONCAT                                           ~23     ~22, '+%3D+%3F'
         25        ASSIGN                                                   !1, ~23
  129    26        INIT_STATIC_METHOD_CALL                                  'e'
         27        SEND_VAR_EX                                              !1
         28        INIT_ARRAY                                       ~25     !0
         29        SEND_VAL_EX                                              ~25
         30        DO_FCALL                                      0  $26     
         31        ASSIGN                                                   !3, $26
  131    32        INIT_METHOD_CALL                                         !3, 'fetch'
         33        DO_FCALL                                      0  $28     
         34      > JMPZ                                                     $28, ->75
  133    35    >   FETCH_STATIC_PROP_R          unknown             ~29     'VirtualDeletion'
         36        FETCH_DIM_R                                      ~30     ~29, 'on'
         37      > JMPZ                                                     ~30, ->60
  134    38    >   FETCH_OBJ_R                                      ~31     '_Table'
         39        CONCAT                                           ~32     'UPDATE+', ~31
         40        CONCAT                                           ~33     ~32, '+SET+'
         41        FETCH_STATIC_PROP_R          unknown             ~34     'VirtualDeletion'
         42        FETCH_DIM_R                                      ~35     ~34, 'Field'
         43        CONCAT                                           ~36     ~33, ~35
         44        CONCAT                                           ~37     ~36, '+%3D+%27'
         45        FETCH_STATIC_PROP_R          unknown             ~38     'VirtualDeletion'
         46        FETCH_DIM_R                                      ~39     ~38, 'Value'
         47        CONCAT                                           ~40     ~37, ~39
         48        CONCAT                                           ~41     ~40, '%27+WHERE+'
         49        FETCH_OBJ_R                                      ~42     '_Fields'
         50        FETCH_DIM_R                                      ~43     ~42, 0
         51        CONCAT                                           ~44     ~41, ~43
         52        CONCAT                                           ~45     ~44, '+%3D+%3F'
         53        ASSIGN                                                   !1, ~45
  135    54        INIT_STATIC_METHOD_CALL                                  'e'
         55        SEND_VAR_EX                                              !1
         56        INIT_ARRAY                                       ~47     !0
         57        SEND_VAL_EX                                              ~47
         58        DO_FCALL                                      0          
         59      > JMP                                                      ->73
  138    60    >   FETCH_OBJ_R                                      ~49     '_Table'
         61        CONCAT                                           ~50     'DELETE+FROM+', ~49
         62        CONCAT                                           ~51     ~50, '+WHERE+'
         63        FETCH_OBJ_R                                      ~52     '_Fields'
         64        FETCH_DIM_R                                      ~53     ~52, 0
         65        CONCAT                                           ~54     ~51, ~53
         66        CONCAT                                           ~55     ~54, '+%3D+%3F'
         67        ASSIGN                                                   !1, ~55
  139    68        INIT_STATIC_METHOD_CALL                                  'e'
         69        SEND_VAR_EX                                              !1
         70        INIT_ARRAY                                       ~57     !0
         71        SEND_VAL_EX                                              ~57
         72        DO_FCALL                                      0          
  142    73    > > RETURN                                                   <true>
         74*       JMP                                                      ->84
  145    75    >   NEW                                              $59     'Exception'
         76        CONCAT                                           ~60     'O+id+', !0
         77        CONCAT                                           ~61     ~60, '+n%C3%A3o+pode+ser+exclu%C3%ADdo+da+tabela+'
         78        FETCH_OBJ_R                                      ~62     '_Table'
         79        CONCAT                                           ~63     ~61, ~62
         80        CONCAT                                           ~64     ~63, '+pois+n%C3%A3o+existe.'
         81        SEND_VAL_EX                                              ~64
         82        DO_FCALL                                      0          
         83      > THROW                                         0          $59
  146    84*     > RETURN                                                   null

End of function delete

Function update:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 16
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 16
Branch analysis from position: 9
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 16
2 jumps found. (Code = 77) Position 1 = 22, Position 2 = 28
Branch analysis from position: 22
2 jumps found. (Code = 78) Position 1 = 23, Position 2 = 28
Branch analysis from position: 23
1 jumps found. (Code = 42) Position 1 = 22
Branch analysis from position: 22
Branch analysis from position: 28
2 jumps found. (Code = 77) Position 1 = 33, Position 2 = 40
Branch analysis from position: 33
2 jumps found. (Code = 78) Position 1 = 34, Position 2 = 40
Branch analysis from position: 34
1 jumps found. (Code = 42) Position 1 = 33
Branch analysis from position: 33
Branch analysis from position: 40
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 40
Branch analysis from position: 28
Branch analysis from position: 16
filename:       /in/vGHhd
function name:  Update
number of ops:  74
compiled vars:  !0 = $id, !1 = $Field, !2 = $binds, !3 = $fields, !4 = $values, !5 = $query
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  148     0  E >   RECV_INIT                                        !0      null
  150     1        TYPE_CHECK                                    2          !0
          2      > JMPZ                                                     ~6, ->16
  151     3    >   FETCH_OBJ_R                                      ~7      '_Fields'
          4        FETCH_DIM_R                                      ~8      ~7, 0
          5        FETCH_OBJ_R                                      ~9      ~8
          6        ASSIGN                                                   !0, ~9
  153     7        TYPE_CHECK                                    2          !0
          8      > JMPZ                                                     ~11, ->16
  154     9    >   NEW                                              $12     'Exception'
         10        FETCH_OBJ_R                                      ~13     '_Table'
         11        CONCAT                                           ~14     'Imposs%C3%ADvel+realizer+update+em+um+id+nulo+da+tabela+', ~13
         12        CONCAT                                           ~15     ~14, '.'
         13        SEND_VAL_EX                                              ~15
         14        DO_FCALL                                      0          
         15      > THROW                                         0          $12
  157    16    >   INIT_STATIC_METHOD_CALL                                  'Validate', 'Run'
         17        FETCH_THIS                                       $17     
         18        SEND_VAR_EX                                              $17
         19        DO_FCALL                                      0          
  159    20        FETCH_OBJ_R                                      ~19     '_Fields'
         21      > FE_RESET_R                                       $20     ~19, ->28
         22    > > FE_FETCH_R                                               $20, !1, ->28
  160    23    >   CONCAT                                           ~21     '%3A', !1
         24        FETCH_OBJ_R                                      ~23     !1
         25        ASSIGN_DIM                                               !2, ~21
         26        OP_DATA                                                  ~23
  159    27      > JMP                                                      ->22
         28    >   FE_FREE                                                  $20
  162    29        FETCH_OBJ_R                                      ~24     '_Fields'
         30        ASSIGN                                                   !3, ~24
  163    31        UNSET_DIM                                                !3, 0
  165    32      > FE_RESET_R                                       $26     !3, ->40
         33    > > FE_FETCH_R                                               $26, !1, ->40
  166    34    >   CONCAT                                           ~28     !1, '+%3D+'
         35        FETCH_OBJ_R                                      ~29     !1
         36        CONCAT                                           ~30     ~28, ~29
         37        ASSIGN_DIM                                               !4
         38        OP_DATA                                                  ~30
  165    39      > JMP                                                      ->33
         40    >   FE_FREE                                                  $26
  168    41        INIT_FCALL                                               'implode'
         42        SEND_VAL                                                 '%2C+'
         43        SEND_VAR                                                 !4
         44        DO_ICALL                                         $32     
         45        ASSIGN_DIM                                               !4
         46        OP_DATA                                                  $32
  170    47        FETCH_OBJ_R                                      ~33     '_Table'
         48        CONCAT                                           ~34     'UPDATE+', ~33
         49        CONCAT                                           ~35     ~34, '+SET+'
         50        CONCAT                                           ~36     ~35, !4
         51        CONCAT                                           ~37     ~36, '+WHERE+'
         52        FETCH_OBJ_R                                      ~38     '_Fields'
         53        FETCH_DIM_R                                      ~39     ~38, 0
         54        CONCAT                                           ~40     ~37, ~39
         55        CONCAT                                           ~41     ~40, '+%3D+%3A'
         56        FETCH_OBJ_R                                      ~42     '_Fields'
         57        FETCH_DIM_R                                      ~43     ~42, 0
         58        CONCAT                                           ~44     ~41, ~43
         59        ASSIGN                                                   !5, ~44
  172    60        INIT_STATIC_METHOD_CALL                                  'e'
         61        SEND_VAR_EX                                              !5
         62        SEND_VAR_EX                                              !2
         63        DO_FCALL                                      0          
  175    64        FETCH_OBJ_R                                      ~48     '_Table'
         65        FETCH_OBJ_R                                      ~50     '_Fields'
         66        FETCH_DIM_R                                      ~51     ~50, 0
         67        FETCH_STATIC_PROP_UNSET                          $47     '_Cache'
         68        FETCH_DIM_UNSET                                  $49     $47, ~48
         69        UNSET_DIM                                                $49, ~51
  178    70        INIT_METHOD_CALL                                         'Select'
         71        SEND_VAR_EX                                              !0
         72        DO_FCALL                                      0          
  179    73      > RETURN                                                   null

End of function update

Function clear:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vGHhd
function name:  Clear
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  185     0  E >   UNSET_STATIC_PROP                                        '_Cache'
  186     1      > RETURN                                                   null

End of function clear

Function e:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vGHhd
function name:  e
number of ops:  12
compiled vars:  !0 = $query, !1 = $binds, !2 = $_stmt
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  188     0  E >   RECV                                             !0      
          1        RECV              

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.72 ms | 1428 KiB | 15 Q