Skip to content

1.8.0

Latest

Choose a tag to compare

@Jeckerson Jeckerson released this 12 Nov 12:18

Changed

  • Added an inline cache to each method and static call site, so a call on the same class from the same class runs the method it resolved before without looking it up again #2790
  • Changed == and != between null and a var, string or array to PHP's loose comparison, where false, 0, 0.0, "" and [] equal null, reported by the new loose-null-comparison warning; use === to test for null #2820
  • Changed __METHOD__ to PHP's Class::method, with the namespace, the declaring trait of a trait method and the namespaced name in a function #2825
  • Changed __FUNCTION__ and __METHOD__ in a closure to the name PHP gives it, Ns\{closure} before PHP 8.4 and {closure:Class::method():LINE} from 8.4 #2825
  • Added a cache record to each static property access, so a repeated read or write of self::x, parent::x or X::x skips the property lookup #2805
  • Raised the minimum ext-zephir_parser to 2.11.0 for the X::class parameter default grammar and the closure start line PHP 8.4 names a closure after #2825

Fixed

  • Fixed a recursive this->m() in a loop, and a call in a loop on a local first assigned with new, running the method another object's class resolved to #2790
  • Fixed a computed bool in an array literal, such as ["k": a > b], being stored as false #2771
  • Fixed a computed bool argument to a PHP function, such as intval(a > b), failing to compile #2771
  • Fixed == and === between a bool local or computed bool and a var always comparing the var with false, which broke switch true { case x: } #2771
  • Fixed a switch true case such as typeof x == "string" never matching #2771
  • Fixed a bool or null compared with a number being compared as numbers instead of as bool values #2771
  • Fixed <, <=, > and >= between a bool and a var, and comparisons of a bool local with an int local or another bool, or of a native local with null, failing to compile #2771
  • Fixed comparing a var with a double crashing the compiler, or failing to load because zephir_compare_strict_double() was missing #2771
  • Fixed a double compared with an integer or a var being truncated to an integer, and === between an integer and a double being true #2771
  • Fixed > and >= against a var holding NAN being true #2771
  • Fixed a char extension global in a comparison being emitted as a multi-character C constant #2771
  • Fixed a property default array key that is a constant or an expression, such as self::ON, failing to compile #2771
  • Fixed PHP bool constants such as ZEND_THREAD_SAFE and "boolean" extension globals failing to compile #2771
  • Fixed <, <=, > and >= between null and a var, string or array comparing types instead of values #2820
  • Fixed null compared with an array local or a string or array literal failing to compile #2820
  • Fixed an explicit null passed to a nullable array or string parameter becoming [] or "" #2820
  • Fixed fetch and empty on an empty array element writing into the source array, corrupting OPcache shared memory and Zephir array constants #2826
  • Fixed X::class of a global class, such as DateTime::class, and parent::class of a global parent starting with a backslash #2825
  • Fixed X::class failing to compile for a class unknown at compile time, and not keeping the case it is written in #2825
  • Fixed a use alias written in another case, such as datetime after use DateTime, not naming the imported class #2825
  • Fixed self::class, X::class, __CLASS__, __NAMESPACE__ and __METHOD__ corrupting a namespace segment that starts like a C escape, such as \nested #2825
  • Fixed __METHOD__, __CLASS__ and __NAMESPACE__ in a function crashing the compiler, and __TRAIT__ being unsupported #2825
  • Fixed names in a method, property or constant merged from a trait resolving against the using class's file instead of the trait's #2825
  • Fixed self, parent and static in a closure resolving against the closure class instead of the class it is written in and its called class #2825
  • Fixed self, parent and static in a closure written in a function not throwing PHP's Error #2825
  • Fixed let this->prop[] = value in a closure failing to compile #2825
  • Fixed new parent() and instanceof parent with a namespaced PHP parent class failing to compile #2825
  • Fixed a class redefining a constant of its parent failing at module startup #2825
  • Fixed self::method() of a non-static method from a static context crashing instead of throwing PHP's Error #2825
  • Fixed a class constant, X::class or PHP constant as an array constant element or key, or as a typed or trait property default, failing to compile #2825
  • Fixed a property default reading a single-quoted string constant being null #2825
  • Fixed \Attribute::TARGET_* as an array constant key becoming 0 #2825
  • Fixed static:: in a class constant being accepted, where PHP refuses it #2825
  • Fixed a class constant read from another class resolving self:: against the reading class #2825
  • Fixed a PHP string constant with a control character, such as PHP_EOL, in a declaration producing invalid C #2825
  • Fixed X::class, and a class constant or X::class as an array key, failing to parse as a parameter default #2825
  • Fixed a non-empty array parameter default being empty, or failing to compile on an untyped parameter #2825
  • Fixed Reflection reporting no default for an untyped parameter and the wrong default for an array, a union-typed or an escaped string parameter #2825
  • Fixed IDE stubs escaping a string constant twice, such as 'Stub\\\\Constants' #2825
  • Fixed reading an uninitialized typed static property, alone or in +=, -=, *= or .=, not throwing PHP's Error #2805
  • Fixed isset of a static property, and of a property named by a string such as this->{"x"}, always being true #2805
  • Fixed a copy read from a property or static property that PHP code holds by reference changing the property #2805
  • Fixed code after a static property assignment that throws, such as a TypeError, still running #2805
  • Fixed a property read answered by __get(), such as o->x, leaking the value it returned #2805
  • Fixed a static property read in some methods freeing the property's value at the end of the method #2805
  • Fixed a property read such as o->x calling __isset() before __get(), and reading null when __isset() returned false #2831
  • Fixed reading a protected or private property from outside its class giving null instead of throwing PHP's Error #2784
  • Fixed reading an undefined property, or a property of a non-object, not raising PHP's warning #2808
  • Fixed reading an uninitialized typed property giving null instead of throwing PHP's Error #2831
  • Fixed empty o->x calling __get() on an object without __isset(), where PHP treats the property as empty #2831
  • Fixed isset o->x->y and empty o->x->y raising a notice when o or o->x is not an object #2831
  • Fixed o->{n} with a non-string n, such as an int, always reading null and failing isset instead of converting the name as PHP does #2831
  • Fixed code after a property read, isset or empty that throws still running #2831
  • Fixed isset of a property in one block of a method and of the same property after that block generating C that does not compile #2831