- version 3.6
Check those constraints:
$this->anything()
In the Stack Overflow PHP chat you may notice the regulars using tags like cv-pls
, cv-ring
and delv-pls
. These tags are used only in the chat room to communicate with other users that a question or answer may need more votes to be closed or deleted. The PHP tag has a lot of inferior quality and duplicative information on Stack Overflow. We feel that inferior quality questions bring down the site and make it harder to find good information, particularly about PHP. By closing and merging these questions as appropriate you'll find the information you need quicker.
cv-ring
is just a 'funny name' we give to the group of regulars who use the tagscv-pls
is an in-chat tag that communicates "Hey, this question may be of inferior quality. Check it out and, if you feel appropriate, cast a close vote."delv-pls
is an in-chat tag that communicates "Hey, this question has alrAn introduction to curl
using GitHub's API.
Makes a basic GET request to the specifed URI
curl https://api.github.com/users/caspyin
<?php | |
// Displays all array indices and object properties | |
ini_set('xdebug.var_display_max_children', -1); | |
// Displays all string data dumped | |
ini_set('xdebug.var_display_max_data', -1); | |
// Controls nested level displayed, maximum is 1023 | |
ini_set('xdebug.var_display_max_depth', -1); |
# Export Active Record model as a CSV file | |
# | |
def self.render_csv active_record_model | |
CSV.generate do |csv| | |
csv << active_record_model.column_names | |
active_record_model.all.each do |m| | |
values = active_record_model.column_names.map{ |f| m.send f.to_sym } | |
csv << values | |
end | |
end |
<!-- | |
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ | |
░░░░░▄▄▄▄▀▀▀▀▀▀▀▀▄▄▄▄▄▄░░░░░░░░░░░░░░░░░░░░░░░░░░░░ | |
░░░░░█░░░░▒▒▒▒▒▒▒▒▒▒▒▒░░▀▀▄░░░░░░░░░░░░░░░░░░░░░░░░ | |
░░░░█░░░▒▒▒▒▒▒░░░░░░░░▒▒▒░░█░░░░░░░░░░░░░░░░░░░░░░░ | |
░░░█░░░░░░▄██▀▄▄░░░░░▄▄▄░░░░█░░░░░░░░░░░░░░░░░░░░░░ | |
░▄▀▒▄▄▄▒░█▀▀▀▀▄▄█░░░██▄▄█░░░░█░░░░░░░░░░░░░░░░░░░░░ | |
█░▒█▒▄░▀▄▄▄▀░░░░░░░░█░░░▒▒▒▒▒░█░░░░░░░░░░░░░░░░░░░░ | |
█░▒█░█▀▄▄░░░░░█▀░░░░▀▄░░▄▀▀▀▄▒█░░░░░░░░░░░░░░░░░░░░ | |
░█░▀▄░█▄░█▀▄▄░▀░▀▀░▄▄▀░░░░█░░█░░░░░░░░░░░░░░░░░░░░░ |
Sirs, Gentlemen and Scholars,
I am appreciative of all of the discussion that has happened on the mysql_deprecation RFC (https://wiki.php.net/rfc/mysql_deprecation). It has helped me understand how we feel collectively about ext/mysql and how to deprecate it. I believe that clarifying what the term 'deprecation' means could help everyone to understand what we are trying to accomplish.
To quote wikipedia on the word 'deprecation':
In the process of authoring computer software, its standards or documentation, or other technical standards, deprecation is a status applied to features, characteristics, or practices to indicate that they should be avoided, typically because they have been superseded.
I think we all agree that ext/mysql should be avoided and that it has been superseded. What I want to point out is that deprecation is a process. The real question is: have we taken the proper steps in that process?
This is just a small post in response to [this tweet][tweet] by Julien Pauli (who by the way is the release manager for PHP 5.5). In the tweet he claims that objects use more memory than arrays in PHP. Even though it can be like that, it's not true in most cases. (Note: This only applies to PHP 5.4 or newer.)
The reason why it's easy to assume that objects are larger than arrays is because objects can be seen as an array of properties and a bit of additional information (like the class it belongs to). And as array + additional info > array
it obviously follows that objects are larger. The thing is that in most cases PHP can optimize the array
part of it away. So how does that work?
The key here is that objects usually have a predefined set of keys, whereas arrays don't: