Codex

Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

User:Hakre/PHP5-List

Back to my Page

Patch Notes

Tickets Created / Watchlist

Done / Closed

Ticketed Ideas / Related Tickets

Function Stack

  • $this->__construct( $data );
  • ...

Todo

  • Some constructors return values (e.g. empty strings) if the object can not be initialized properly. This is not possible, they should throw an exception instead. Reference

General Notes

  • Type Hinting - a common concept of wordpress core developers for function I/O in the past was: "shit in shit out". Type hints can be used to lightweightly hint the type functions do accept of a parameter. next to no type this can be array or object, read more.
  • scandir - scandir can be used instead the known opendir() / readdir() operations we currently have in.
  • foreach - can use references now. that will help to reduce code where in php iteration needed to differ between array or object (post data, comment data and the like). Do not forget to unset iterating value variable in case of reference after the foreach-loop. (#16684)
  • & new - not needed any longer. (#16767)
  • __construct and __destruct - faux and faulty PHP 4 workarounds can be removed. check all default classes constructors and destructors therefore. #10861
  • wp_clone() - function not needed any longer (#16813)
  • stripos() - native function can be applied everyhwere now. #11176
  • compat functions - some - most certainly even all of them can be removed now. #16918
  • curly string syntax - better support of classes in {$} (PHP docs).
  • mysqli - the usage of mysqli instead of mysql is strongly* recommended.
  • mysqli - prepared statements. let's see. #11608
  • PDO - prepared statements / abstraction. let's see. #11622
  • Widget IDs - this is handeled differently for PHP 4 and PHP 5 (>= 5.2.0) (spl_object_hash).
  • Autoloading - spl_autoload_register() to load classes. #14710
  • microtime - get as float parameter available since PHP 5 (>= 5.0.0) @see timer_start()
  • (array) casting - array casts are partially overused in core code and prevent usage of the SPL/Iterators.
  • mkdir() - allows the creation of nested directories specified in the pathname since PHP 5 (>= 5.0.0) (mkdir()). @see wp_mkdir_p() and WP_Filesystem_Direct. #14928
  • str_replace() - has a $count parameter now. #16903
  • setcookie() has httponly parameter now - setcookie() #16920
  • E_RECOVERABLE_ERROR is available since PHP 5.2.0 #16920
  • Static class method Callback Pseudo type support - "::" for static functions now as "class::method" instead of array('class', 'method'). (As of PHP 5.2.3).
  • FILE_IGNORE_NEW_LINES and other file() - flags.

TODO

  • Check for parse_url (), has components parameter now.

5.3 Notes

  • __DIR__ - replaces dirname(__FILE__).
  • closures - create_function() can be replaced with closures starting with PHP 5.3. #10493
  • HTTP 1.1 Support - PHP prior to 5.3.0 does not implement chunked transfer decoding (REF).

5.3.3 Notes

  • parse_url() - does not emmits a warning any longer. @ can be removed in front of those then.