rfc:get_debug_type

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
rfc:get_debug_type [2020/03/01 13:21]
marandall
rfc:get_debug_type [2020/08/01 23:41] (current)
carusogabriel RFC was implemented
Line 3: Line 3:
   * Date: 2020-02-15   * Date: 2020-02-15
   * Author: Mark Randall, marandall@php.net   * Author: Mark Randall, marandall@php.net
-  * Status: Voting+  * Status: Implemented
   * First Published at: https://wiki.php.net/rfc/get_debug_type   * First Published at: https://wiki.php.net/rfc/get_debug_type
  
Line 17: Line 17:
   // must be present to convert long-form "integer" into int etc.   // must be present to convert long-form "integer" into int etc.
   throw new TypeError('Expected ' . Foo::class . ' got ' . (is_object($bar) ? get_class($bar) : gettype($bar)));   throw new TypeError('Expected ' . Foo::class . ' got ' . (is_object($bar) ? get_class($bar) : gettype($bar)));
 +}
 +
 +// would become
 +if (!($bar instanceof Foo)) { 
 +  throw new TypeError('Expected ' . Foo::class . ' got ' . get_debug_type($bar));
 } }
  
Line 47: Line 52:
 ===== Voting ===== ===== Voting =====
  
-<doodle title="Add get_debug_type as described" auth="marandall" voteType="single" closed="false">+<doodle title="Add get_debug_type as described" auth="marandall" voteType="single" closed="true">
    * Yes    * Yes
    * No    * No
rfc/get_debug_type.1583068894.txt.gz · Last modified: 2020/03/01 13:21 by marandall