|   | php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
| 
 PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits              [2018-12-23 14:20 UTC] cmb@php.net
 
-Status:      Open
+Status:      Verified
-Package:     Class/Object related
+Package:     Scripting Engine problem
-Assigned To:
+Assigned To: dmitry
  [2018-12-23 14:20 UTC] cmb@php.net
  [2018-12-23 14:21 UTC] cmb@php.net
  [2018-12-24 10:25 UTC] dmitry@php.net
  [2018-12-24 10:25 UTC] dmitry@php.net
 
-Status: Verified
+Status: Closed
 | |||||||||||||||||||||||||||
|  Copyright © 2001-2025 The PHP Group All rights reserved. | Last updated: Fri Oct 31 01:00:01 2025 UTC | 
Description: ------------ This only happened in PHP 7.3. Test script followed. $arguments should be ['getSomeWhat'], but __callStatic get [?] here. I checked *myht->arData, $arguments[0] got a wrong type. The normal one, you can see type = 0x6: (_zval_struct::(anonymous union)) u1 = { (_zval_struct::(anonymous struct)) v = { (zend_uchar) type = '\x06' (zend_uchar) type_flags = '\x01' (_zval_struct::(anonymous union)) u = { (uint16_t) call_info = 0 (uint16_t) extra = 0 } } (uint32_t) type_info = 262 } (lldb) fr v --show-types *myht->arData->val.value.str (zend_string) *myht->arData->val.value.str = { (zend_refcounted_h) gc = { (uint32_t) refcount = 1 (_zend_refcounted_h::(anonymous union)) u = { (uint32_t) type_info = 6 } } (zend_ulong) h = 0 (size_t) len = 6 (char [1]) val = "aaazzz" } The __callStatic's argument, you can see data is normal but type is not initialized. (_zval_struct::(anonymous union)) u1 = { (_zval_struct::(anonymous struct)) v = { (zend_uchar) type = '\0' (zend_uchar) type_flags = '\0' (_zval_struct::(anonymous union)) u = { (uint16_t) call_info = 0 (uint16_t) extra = 0 } } (uint32_t) type_info = 0 } (_zval_struct::(anonymous union)) u2 = { (uint32_t) next = 4294967295 (uint32_t) cache_slot = 4294967295 (uint32_t) opline_num = 4294967295 (uint32_t) lineno = 4294967295 (uint32_t) num_args = 4294967295 (uint32_t) fe_pos = 4294967295 (uint32_t) fe_iter_idx = 4294967295 (uint32_t) access_flags = 4294967295 (uint32_t) property_guard = 4294967295 (uint32_t) constant_flags = 4294967295 (uint32_t) extra = 4294967295 } Test script: --------------- <?php class Foo { static function __callStatic($name, $arguments) { if ($name === 'get') { if (!isset($arguments[0])) { var_dump(['getSomeWhat']); var_dump($arguments); exit; } } echo 'OK'; } protected function get ($key) { // BUG!!! } } class Bar { static function __callStatic($name, $arguments) { echo Foo::get('getSomeWhat'); } } Bar::someUndefinedStaticFunction(); Expected result: ---------------- OK Actual result: -------------- array(1) { [0]=> string(11) "getSomeWhat" } array(1) { }