php

PHP Internals News: Episode 51: Object Ergonomics - Derick Rethans

PHP Internals News: Episode 51: Object Ergonomics

In this episode of "PHP Internals News" I talk with Larry Garfield (Twitter, Website, GitHub) about a blog post that he was written related to PHP's Object Ergonomics.

The RSS feed for this podcast is https://derickrethans.nl/feed-phpinternalsnews.xml, you can download this episode's MP3 file, and it's available on Spotify and iTunes. There is a dedicated website: https://phpinternals.news

Transcript

Derick Rethans 0:16

Hi, I'm Derick. And this is PHP internals news, a weekly podcast dedicated to demystifying the development of the PHP language. This is Episode 51. Today I'm talking with Larry Garfield, not about an RFC for once, but about a blog post that he's written called Object Ergonomics. Larry, would you please introduce yourself?

Larry Garfield 0:38

Hello World. My name is Larry Garfield, also Crell, CRELL, on various social medias. I work at platform.sh in developer relations. We're a continuous deployment cloud hosting company. I've been writing PHP for 21 years and been a active gadfly and nudge for at least 15 of those.

Derick Rethans 1:01

In the last couple of months, we have seen quite a lot of smaller RFCs about all kinds of little features here and there, to do with making the object oriented model of PHP a little bit better. I reckon this is also the nudge behind you writing a slightly longer blog post titled "Improving PHP object ergonomics".

Larry Garfield 1:26

If by slightly longer you mean 14 pages? Yes.

Derick Rethans 1:29

Yes, exactly. Yeah, it took me a while to read through. What made you write this document?

Larry Garfield 1:34

As you said, there's been a lot of discussion around improving PHP's general user experience of working with objects in PHP. Where there's definitely room for improvement, no question. And I found a lot of these to be useful in their own right, but also very narrow and narrow in ways that solve the immediate problem but could get in the way of solving larger problems later on down the line. So I went into this with an attitude of: Okay, we can kind of piecemeal and attack certain parts of the problem space. Or we can take a step back and look at the big picture and say: Alright, here's all the pain points we have. What can we do that would solve not just this one pain point. But let us solve multiple pain points with a single change? Or these two changes together solve this other pain point as well. Or, you know, how can we do this in a way that is not going to interfere with later development that we've talked about. We know we want to do, but isn't been done yet. So how do we not paint ourselves into a corner by thinking too narrow?

Derick Rethans 2:41

It's a curious thing, because a more narrow RFC is likely easier to get accepted, because it doesn't pull in a whole set of other problems as well. But of course, as you say, if the whole idea hasn't been thought through, then some of these things might not actually end up being beneficial. Because it can be combined with some other things to directly address the problems that we're trying to solve, right?

Larry Garfield 3:07

Yeah, it comes down to what are the smallest changes we can make that taken together have the largest impact. That kind of broad picture thinking is something that is hard to do in PHP, just given the way it's structured. So I took a stab at that.

Derick Rethans 3:21

What are the main problems that we should address?

Larry Garf

Truncated by Planet PHP, read more at the original (another 29525 bytes)





php

PHP Internals News: Episode 52: Floats and Locales - Derick Rethans

PHP Internals News: Episode 52: Floats and Locales

In this episode of "PHP Internals News" I talk with George Banyard (Website, Twitter, GitHub, GitLab) about an RFC that he has proposed together with Máté Kocsis (Twitter, GitHub, LinkedIn) to make PHP's float to string logic no longer use locales.

The RSS feed for this podcast is https://derickrethans.nl/feed-phpinternalsnews.xml, you can download this episode's MP3 file, and it's available on Spotify and iTunes. There is a dedicated website: https://phpinternals.news

Transcript

Derick Rethans 0:16

Hi, I'm Derick. And this is PHP internals news, a weekly podcast dedicated to demystifying the development of the PHP language. This is Episode 52. Today I'm talking with George Banyard about an RFC that he's made together with Mate Kocsis. This RFC is titled locale independent floats to string. Hello, George, would you please introduce yourself?

George Banyard 0:39

Hello, I'm George Peter Banyard. I'm a student at Imperial College and I work on PHP in my free time.

Derick Rethans 0:47

All right, so we're talking about local independent floats. What is the problem here?

George Banyard 0:52

Currently when you do a float to string conversion, so all casting or displaying a float, the conversion will depend on like the current local. So instead of always using like the decimal dot separator. For example, if you have like a German or the French locale enabled, it will use like a comma to separate like the decimals.

Derick Rethans 1:14

Okay, I can understand that that could be a bit confusing. What are these locales exactly?

George Banyard 1:20

So locales, which are more or less C locales, which PHP exposes to user land is a way how to change a bunch of rules on how string and like stuff gets displayed on the C level. One of the issues with it is that like it's global. For example, if you use like a thread safe API, if you use the thread safe PHP version, then set_locale() is not thread safe, so we'll just like impact other threads where you're using it.

Derick Rethans 1:50

So a locale is a set of rules to format specific things with floating point numbers being one of them in which situations does the locale influence the display a floating point numbers in every situation in PHP or only in some?

George Banyard 2:06

Yes, it only impacts like certain aspects, which is quite surprising. So a string cast will affect it the strval() function, vardump(), and debug_zval_dump() will all affect the decimal locator and also printf() with the percentage lowercase F, but that's expected because it's locale aware compared to the capital F modifier.

Derick Rethans 2:32

But it doesn't, for example, have the same problem in the serialised function or say var_export().

George Banyard 2:37

Yeah, and json_encode() also doesn't do that. PDO has special code which handles also this so that like all the PDO drivers get like a constant treat like float string, because that could like impact on the databases.

Derick Rethans 2:53

How is it a problem that with some locales enabled and then uses a comma instead of the decimal point. How can this cause bugs and PHP applications?

Truncated by Planet PHP, read more at the original (another 17468 bytes)




php

Using PHPMyadmin to delete old tables in your WordPress database

I had to use PHPMyadmin a few days ago to delete old tables in my WordPress Database. They were created by a plugin that I tried but decided not to use. Normally when you uninstall a plugin the developer deletes the tables in your database that they create. In this case this author didn’t. It […]





php

PHP Cuban Personal Identification Number Parser

Package:
Summary:
Parse a Cuban personal identification number
Groups:
Author:
Description:
This class can parse a Cuban personal identification number...

Read more at https://www.phpclasses.org/package/11607-PHP-Parse-a-Cuban-personal-identification-number.html#2020-04-10-18:46:04




php

PHP Open Graph Meta Tags

Package:
Summary:
Generate HTML to insert Open Graph tag attributes
Groups:
Author:
Description:
This package can be used to generate HTML to insert Open Graph tag attributes...

Read more at https://www.phpclasses.org/package/11610-PHP-Generate-HTML-to-insert-Open-Graph-tag-attributes.html#2020-04-12-14:15:57




php

PHP Covid Relief Checks Calculator

Package:
Summary:
Calculate the amount of a check as Covid-19 relief
Groups:
Author:
Description:
This class can be used to calculate the amount of a check as Covid-19 relief...

Read more at https://www.phpclasses.org/package/11613-PHP-Calculate-the-amount-of-a-check-as-Covid-19-relief.html#2020-04-15-13:57:30




php

PHP Multi Curl Library

Package:
Summary:
Process multiple HTTP requests at the same time
Groups:
Author:
Description:
This class can process multiple HTTP requests at the same time...

Read more at https://www.phpclasses.org/package/11617-PHP-Process-multiple-HTTP-requests-at-the-same-time.html#2020-04-16-06:31:11




php

PHP Wikipedia API

Package:
Summary:
Edit and retrieve content from Wikipedia
Groups:
Author:
Description:
This class can be used to edit and retrieve content from Wikipedia...

Read more at https://www.phpclasses.org/package/11609-PHP-Edit-and-retrieve-content-from-Wikipedia.html#2020-04-17-12:29:39




php

PHP Barcode Generator Save Image (New)

Package:
Summary:
Generate barcode images in several formats
Groups:
Author:
Description:
This package can generate barcode images in several formats...

Read more at https://www.phpclasses.org/package/11615-PHP-Generate-barcode-images-in-several-formats.html




php

PHP JSON Form Builder

Package:
Summary:
Generate a HTML form definition in JSON format
Groups:
Author:
Description:
This class can generate a HTML form definition in JSON format...

Read more at https://www.phpclasses.org/package/11612-PHP-Generate-a-HTML-form-definition-in-JSON-format.html#2020-04-18-04:36:17




php

Minimal Twilio PHP API Send SMS

Package:
Summary:
Send SMS messages using the Twilio API
Groups:
Author:
Description:
This package can be used to send SMS messages using the Twilio API...

Read more at https://www.phpclasses.org/package/11620-PHP-Send-SMS-messages-using-the-Twilio-API.html#2020-04-19-01:34:29




php

PHP Zoom API

Package:
Summary:
Access Zoom video conference application REST API
Groups:
Author:
Description:
This class can be used to access Zoom video conference application REST API...

Read more at https://www.phpclasses.org/package/11621-PHP-Access-Zoom-video-conference-application-REST-API.html#2020-04-20-07:39:22




php

PHP Unique Number Generator (New)

Package:
Summary:
generateUniquesNumbers
Groups:
Author:
Description:
This class can generate a list of unique numbers...

Read more at https://www.phpclasses.org/package/11616-PHP-generateUniquesNumbers.html




php

PHP Mortgage Calculator

Package:
Summary:
Calculate monthly payments for mortgage
Groups:
Author:
Description:
This class can calculate monthly payments for mortgage...

Read more at https://www.phpclasses.org/package/11623-PHP-Calculate-monthly-payments-for-mortgage.html#2020-04-23-02:56:09




php

leomoon PHP Twitter RSS

Package:
Summary:
Generate RSS feeds from Twitter user statuses
Groups:
Author:
Description:
This package can generate RSS feeds from Twitter statuses...

Read more at https://www.phpclasses.org/package/11626-PHP-Generate-RSS-feeds-from-Twitter-user-statuses.html#2020-04-25-23:47:23




php

Simple PHP Web Terminal Emulator

Package:
Summary:
Display the output of terminal commands in a page
Groups:
Author:
Description:
This class can display the output of terminal commands in a page...

Read more at https://www.phpclasses.org/package/11627-PHP-Display-the-output-of-terminal-commands-in-a-page.html#2020-04-26-20:23:19




php

mezon PHP Router Library

Package:
Summary:
Route HTTP requests mapping URLs into classes
Groups:
Author:
Description:
This package can route HTTP requests mapping URLs into classes...

Read more at https://www.phpclasses.org/package/11631-PHP-Route-HTTP-requests-mapping-URLs-into-classes.html#2020-04-29-03:57:19




php

PHP Async HTTP Client Benchmarks (New)

Package:
Summary:
Measure the performance of different HTTP clients
Groups:
Author:
Description:
This package can measure the performance of different HTTP clients...

Read more at https://www.phpclasses.org/package/11636-PHP-Measure-the-performance-of-different-HTTP-clients.html




php

PHP DAL

Package:
Summary:
Simplify the access databases using PDO
Groups:
Author:
Description:
This class can simplify the access databases using PDO...

Read more at https://www.phpclasses.org/package/11611-PHP-Simplify-the-access-databases-using-PDO.html#2020-05-03-11:22:35




php

SIREN PHP Templating Library

Package:
Summary:
Template engine featuring recursion and nesting
Groups:
Author:
Description:
This package provides a template engine featuring nesting and inclusion...

Read more at https://www.phpclasses.org/package/11637-PHP-Template-engine-featuring-recursion-and-nesting.html#2020-05-04-07:38:49




php

PHP Web Push Notifications Server

Package:
Summary:
Queue and push notifications to Web users
Groups:
Author:
Description:
This package can queue and push notifications to Web users...

Read more at https://www.phpclasses.org/package/11632-PHP-Queue-and-push-notifications-to-Web-users.html#2020-05-05-07:06:25




php

mezon PHP POP3 Client

Package:
Summary:
Retrieve email messages from a mailbox using POP3
Groups:
Author:
Description:
This class can retrieve email messages from a mailbox using POP3...

Read more at https://www.phpclasses.org/package/11639-PHP-Retrieve-email-messages-from-a-mailbox-using-POP3.html#2020-05-06-21:31:11




php

PHP Order Array Trait (New)

Package:
Summary:
Sort arrays of indexed strings with custom sorting
Groups:
Author:
Description:
This package can be used to sort arrays of indexed strings with custom sorting...

Read more at https://www.phpclasses.org/package/11640-PHP-Sort-arrays-of-indexed-strings-with-custom-sorting.html




php

PHP Logging Class

Package:
Summary:
Log application messages to files
Groups:
Author:
Description:
This class can be used to log application messages to files...

Read more at https://www.phpclasses.org/package/11642-PHP-Log-application-messages-to-files.html#2020-05-08-00:16:10




php

PHP Download Files and Log

Package:
Summary:
Serve local and remote files for download
Groups:
Author:
Description:
This class can be used to serve local and remote files for download and log the download activity...

Read more at https://www.phpclasses.org/package/11635-PHP-Serve-local-and-remote-files-for-download.html#2020-05-08-08:26:48




php

Seychellois Rupee(SCR)/Philippine Peso(PHP)

1 Seychellois Rupee = 2.9412 Philippine Peso




php

Trinidad and Tobago Dollar(TTD)/Philippine Peso(PHP)

1 Trinidad and Tobago Dollar = 7.4724 Philippine Peso



  • Trinidad and Tobago Dollar

php

Swedish Krona(SEK)/Philippine Peso(PHP)

1 Swedish Krona = 5.1674 Philippine Peso




php

Slovak Koruna(SKK)/Philippine Peso(PHP)

1 Slovak Koruna = 2.2739 Philippine Peso




php

Serbian Dinar(RSD)/Philippine Peso(PHP)

1 Serbian Dinar = 0.4656 Philippine Peso




php

Polish Zloty(PLN)/Philippine Peso(PHP)

1 Polish Zloty = 12.009 Philippine Peso




php

Qatari Rial(QAR)/Philippine Peso(PHP)

1 Qatari Rial = 13.8683 Philippine Peso




php

Indian Rupee(INR)/Philippine Peso(PHP)

1 Indian Rupee = 0.6688 Philippine Peso




php

Pakistani Rupee(PKR)/Philippine Peso(PHP)

1 Pakistani Rupee = 0.3163 Philippine Peso




php

Sierra Leonean Leone(SLL)/Philippine Peso(PHP)

1 Sierra Leonean Leone = 0.0051 Philippine Peso



  • Sierra Leonean Leone

php

New Taiwan Dollar(TWD)/Philippine Peso(PHP)

1 New Taiwan Dollar = 1.6912 Philippine Peso



  • New Taiwan Dollar

php

Thai Baht(THB)/Philippine Peso(PHP)

1 Thai Baht = 1.577 Philippine Peso




php

Turkish Lira(TRY)/Philippine Peso(PHP)

1 Turkish Lira = 7.1229 Philippine Peso




php

Singapore Dollar(SGD)/Philippine Peso(PHP)

1 Singapore Dollar = 35.7436 Philippine Peso




php

Mauritian Rupee(MUR)/Philippine Peso(PHP)

1 Mauritian Rupee = 1.2716 Philippine Peso




php

Nepalese Rupee(NPR)/Philippine Peso(PHP)

1 Nepalese Rupee = 0.4175 Philippine Peso




php

Bangladeshi Taka(BDT)/Philippine Peso(PHP)

1 Bangladeshi Taka = 0.5941 Philippine Peso




php

Moldovan Leu(MDL)/Philippine Peso(PHP)

1 Moldovan Leu = 2.8318 Philippine Peso




php

Colombian Peso(COP)/Philippine Peso(PHP)

1 Colombian Peso = 0.013 Philippine Peso




php

Uruguayan Peso(UYU)/Philippine Peso(PHP)

1 Uruguayan Peso = 1.1705 Philippine Peso




php

Uzbekistan Som(UZS)/Philippine Peso(PHP)

1 Uzbekistan Som = 0.005 Philippine Peso




php

Russian Ruble(RUB)/Philippine Peso(PHP)

1 Russian Ruble = 0.6879 Philippine Peso




php

Iraqi Dinar(IQD)/Philippine Peso(PHP)

1 Iraqi Dinar = 0.0424 Philippine Peso