Re: [RFC] Strict operators directive

From: Date: Wed, 26 Jun 2019 06:50:29 +0000
Subject: Re: [RFC] Strict operators directive
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-106063@lists.php.net to get a copy of this message
Am 25.06.2019 um 15:09 schrieb Arnold Daniels <arnold.adaniels.nl@gmail.com>: > This RFC proposes a new directive 'strict_operators'. When enabled, operators may > cast operands to the expected type, but must comply to; > > * Typecasting is not based on the type of the other operand > > * Typecasting is not based on the value of any of the operands > * Operators will throw a TypeError for unsupported types While I understand that some people don't like the way PHP does type conversions I think this proposal creates a much bigger element of surprise when copying PHP code from one place to another than all the ..ini-settings ever did. It basically creates two languages in one and I won't be able to determine what $a == 42 exactly does without having to look at the header of the file. I'm inclined to say that if you want to make PHP a new language with a new core type concept then you should fork it and call it something else to avoid confusion. - Chris

« previous php.internals (#106063) next »