PHP hook, building hooks in your application
Introduction
One of the real challenges in building any type of framework, core or application is making it possible for the developers to hook into the business logic at specific points. Since PHP is not event based, nor it works with interrupts you have to come up an alternative.
The test case
Lets assume we are the main developers of a webshop framework. Programmers can use our framework to build complete webshops. Programmers can manage the orders that are placed on the webshop with the order class. The order class is part of our framework and we don’t want it to be extended by any programmer. However we don’t want to limit to programmers in their possibilities to hook into the orders process.
For example programmers should be able to send an email to the webshopowner if an order changes from one specific delivery status to another. This functionality is not part of the default behavior in our framework and is custom for the progammers webshop implementation.
Like said before, PHP doesn’t provide interrupts or real events so we need to come up with another way to implement hooks into our application. Lets take a look at the observer pattern.
Implementing the Observer pattern
The observer pattern is a design-pattern that describes a way for objects to be notified to specific state-changes in objects of the application.
For the first implementation we can use SPL. The SPL provides in two simple objects:
SPLSubject
- attach (new observer to attach)
- detach (existing observer to detach)
- notify (notify all observers)
SPLObserver
- update (Called from the subject (i.e. when it’s value has changed).
iOrderRef = $iOrderRef;
// Get order information from the database or an other resources
$this->iStatus = Order::STATUS_SHIPPED;
}
/**
* Attach an observer
*
* @param SplObserver $oObserver
* @return void
*/
public function attach(SplObserver $oObserver)
{
$sHash = spl_object_hash($oObserver);
if (isset($this->aObservers[$sHash])) {
throw new Exception('Observer is already attached');
}
$this->aObservers[$sHash] = $oObserver;
}
/**
* Detach observer
*
* @param SplObserver $oObserver
* @return void
*/
public function detach(SplObserver $oObserver)
{
$sHash = spl_object_hash($oObserver);
if (!isset($this->aObservers[$sHash])) {
throw new Exception('Observer not attached');
}
unset($this->aObservers[$sHash]);
}
/**
* Notify the attached observers
*
* @param string $sEvent, name of the event
* @param mixed $mData, optional data that is not directly available for the observers
* @return void
*/
public function notify()
{
foreach ($this->aObservers as $oObserver) {
try {
$oObserver->update($this);
} catch(Exception $e) {
}
}
}
/**
* Add an order
*
* @param array $aOrder
* @return void
*/
public function delete()
{
$this->notify();
}
/**
* Return the order reference number
*
* @return int
*/
public function getRef()
{
return $this->iOrderRef;
}
/**
* Return the current order status
*
* @return int
*/
public function getStatus()
{
return $this->iStatus;
}
/**
* Update the order status
*/
public function updateStatus($iStatus)
{
$this->notify();
// ...
$this->iStatus = $iStatus;
// ...
$this->notify();
}
}
/**
* Order status handler, observer that sends an email to secretary
* if the status of an order changes from shipped to delivered, so the
* secratary can make a phone call to our customer to ask for his opinion about the service
*
* @package Shop
*/
class OrderStatusHandler implements SplObserver
{
/**
* Previous orderstatus
* @var int
*/
protected $iPreviousOrderStatus;
/**
* Current orderstatus
* @var int
*/
protected $iCurrentOrderStatus;
/**
* Update, called by the observable object order
*
* @param Observable_Interface $oSubject
* @param string $sEvent
* @param mixed $mData
* @return void
*/
public function update(SplSubject $oSubject)
{
if(!$oSubject instanceof Order) {
return;
}
if(is_null($this->iPreviousOrderStatus)) {
$this->iPreviousOrderStatus = $oSubject->getStatus();
} else {
$this->iCurrentOrderStatus = $oSubject->getStatus();
if($this->iPreviousOrderStatus === Order::STATUS_SHIPPED && $this->iCurrentOrderStatus === Order::STATUS_DELIVERED) {
$sSubject = sprintf('Order number %d is shipped', $oSubject->getRef());
//mail('secratary@example.com', 'Order number %d is shipped', 'Text');
echo 'Mail sended to the secratary to help her remember to call our customer for a survey.';
}
}
}
}
$oOrder = new Order(26012011);
$oOrder->attach(new OrderStatusHandler());
$oOrder->updateStatus(Order::STATUS_DELIVERED);
$oOrder->delete();
?>
There are several problems with the implementation above. To most important disadvantage is that we have only one update method in our observer. In this update method we don’t know when and why we are getting notified, just that something happened. We should keep track of everything that happens in the subject. (Or use debug_backtrace… just joking, don’t even think about using it that way ever!).
Taking it a step further, events
Lets take a look at the next example, we will extend the Observer implementation with some an additional parameter for the eventname that occured.
Finishing up, optional data
iOrderRef = $iOrderRef;
// Get order information from the database or something else...
$this->iStatus = Order::STATUS_SHIPPED;
}
/**
* Attach an observer
*
* @param Observer_Interface $oObserver
* @return void
*/
public function attachObserver(Observer_Interface $oObserver)
{
$sHash = spl_object_hash($oObserver);
if (isset($this->aObservers[$sHash])) {
throw new Exception('Observer is already attached');
}
$this->aObservers[$sHash] = $oObserver;
}
/**
* Detach observer
*
* @param Observer_Interface $oObserver
* @return void
*/
public function detachObserver(Observer_Interface $oObserver)
{
$sHash = spl_object_hash($oObserver);
if (!isset($this->aObservers[$sHash])) {
throw new Exception('Observer not attached');
}
unset($this->aObservers[$sHash]);
}
/**
* Notify the attached observers
*
* @param string $sEvent, name of the event
* @param mixed $mData, optional data that is not directly available for the observers
* @return void
*/
public function notifyObserver($sEvent, $mData=null)
{
foreach ($this->aObservers as $oObserver) {
try {
$oObserver->update($this, $sEvent, $mData);
} catch(Exception $e) {
}
}
}
/**
* Add an order
*
* @param array $aOrder
* @return void
*/
public function add($aOrder = array())
{
$this->notifyObserver('onAdd');
}
/**
* Return the order reference number
*
* @return int
*/
public function getRef()
{
return $this->iOrderRef;
}
/**
* Return the current order status
*
* @return int
*/
public function getStatus()
{
return $this->iStatus;
}
/**
* Update the order status
*/
public function updateStatus($iStatus)
{
$this->notifyObserver('onBeforeUpdateStatus');
// ...
$this->iStatus = $iStatus;
// ...
$this->notifyObserver('onAfterUpdateStatus');
}
}
/**
* Order status handler, observer that sends an email to secretary
* if the status of an order changes from shipped to delivered, so the
* secratary can make a phone call to our customer to ask for his opinion about the service
*
* @package Shop
*/
class OrderStatusHandler implements Observer_Interface
{
protected $iPreviousOrderStatus;
protected $iCurrentOrderStatus;
/**
* Update, called by the observable object order
*
* @param Observable_Interface $oObservable
* @param string $sEvent
* @param mixed $mData
* @return void
*/
public function update(Observable_Interface $oObservable, $sEvent, $mData=null)
{
if(!$oObservable instanceof Order) {
return;
}
switch($sEvent) {
case 'onBeforeUpdateStatus':
$this->iPreviousOrderStatus = $oObservable->getStatus();
return;
case 'onAfterUpdateStatus':
$this->iCurrentOrderStatus = $oObservable->getStatus();
if($this->iPreviousOrderStatus === Order::STATUS_SHIPPED && $this->iCurrentOrderStatus === Order::STATUS_DELIVERED) {
$sSubject = sprintf('Order number %d is shipped', $oObservable->getRef());
//mail('secratary@example.com', 'Order number %d is shipped', 'Text');
echo 'Mail sended to the secratary to help her remember to call our customer for a survey.';
}
}
}
}
$oOrder = new Order(26012011);
$oOrder->attachObserver(new OrderStatusHandler());
$oOrder->updateStatus(Order::STATUS_DELIVERED);
$oOrder->add();
?>
Now we are able to take action on different events that occur.
Disadvantages
Although this implementation works quite well there are some drawbacks. One of those drawbacks is that we need to dispatch an event in our framework, if we don’t programmers can’t hook into our application. Triggering events everywhere give us a small performance penalty however I do think this way of working gives the programmers a nice way to hook into your application on those spots that you want them to hook in.
Just for the record
Notice that this code is just an example and can still use some improvements, for example: each observer is initialized even it will maybe never be notified, therefore I suggest to make use of lazy in some cases for loading the objects. There are other systems to hook into an application, more to follow!
It’s an awesome article for all the online viewers; they will obtain benefit from it I
am sure.
Yua Mikami
24 Oct 25 at 9:22 pm
купить диплом в чайковском [url=https://rudik-diplom2.ru/]купить диплом в чайковском[/url] .
Diplomi_tqpi
24 Oct 25 at 9:24 pm
xbet giri? [url=http://www.1xbet-7.com]http://www.1xbet-7.com[/url] .
1xbet_chol
24 Oct 25 at 9:24 pm
https://t.me/bs_1xbet/29
https://t.me/s/bs_1xbet/35
24 Oct 25 at 9:24 pm
Каждый этап лечения в наркологической клинике «ЮгМед Альянс» имеет свою цель, временные рамки и объективные критерии эффективности. Ниже приведена структура терапевтического цикла, применяемая для большинства пациентов после поступления в отделение.
Разобраться лучше – [url=https://narkologicheskaya-klinika-stavropol0.ru/]наркологическая клиника клиника помощь[/url]
Justinvodia
24 Oct 25 at 9:24 pm
It’s going to be ending of mine day, but before ending I am reading this
fantastic post to improve my experience.
Fuentoro AI
24 Oct 25 at 9:25 pm
https://t.me/s/bs_1xbet/21
https://t.me/bs_1xbet/42
24 Oct 25 at 9:25 pm
Hello there, just became alert to your blog through Google, and found that
it’s truly informative. I’m going to watch out for brussels.
I’ll appreciate if you continue this in future.
Lots of people will be benefited from your writing. Cheers!
Home Page
24 Oct 25 at 9:25 pm
Уборка два раза в год помогает
поддерживать порядок в доме, избегая накопления загрязнений в труднодоступных местах.
40634382
24 Oct 25 at 9:26 pm
купить диплом техникума в новосибирске [url=https://frei-diplom11.ru]купить диплом техникума в новосибирске[/url] .
Diplomi_aisa
24 Oct 25 at 9:26 pm
Hello There. I discovered your blog using msn. That is a
very smartly written article. I will be sure to bookmark it
and come back to learn extra of your helpful information. Thanks for
the post. I will certainly comeback.
Roof replacement company near m
24 Oct 25 at 9:26 pm
Как купить A-PVP в Лангепасе?Обратите внимание https://Comfort-Plan.ru
– ценник адекватный, доставка быстрая. Кто-то пробовал у них? Насколько качественный товар?
Stevenref
24 Oct 25 at 9:28 pm
Listen up, Singapore moms ɑnd dads, mathematics remains likely the highly essential primary subject,
promoting creativity fοr problem-solving
in creative jobs.
Don’t mess around lah, combine а excellent Junior College ᴡith
mathematics excellence fоr ensure superior Ꭺ Levels resultѕ aѕ ᴡell as smooth changeѕ.
Yishun Innova Junior College merges strengths for digital literacy аnd leadership excellence.
Upgraded centers promote development аnd lоng-lasting
knowing. Varied programs іn media and languages foster
creativity and citizenship. Community engagements construct compassion аnd skills.
Trainees Ьecome confident, tech-savvy leaders prepared fօr the digital
age.
Singapore Sports School masterfully stabilizes ѡorld-class
athletic training ᴡith a rigorous scholastic curriculum, committed tο supporting elite
athletes wһo stand οut not just in sports but likewise іn personal and expert life domains.
Tһe school’s personalized academic paths provide flexible scheduling t᧐ accommodate extensive training аnd competitions, guaranteeing trainees
preserve һigh scholastic requirements ѡhile pursuing tһeir sporting passions
with undeviating focus. Boasting tⲟp-tier centers ⅼike Olympic-standard
training arenas, sports science labs, ɑnd healing centers, along with expert coaching fгom
popular specialists, tһe institution supports peak physical performance аnd holistic athlete development.
International exposures tһrough global competitions, exchange programs ѡith overseas
sports academies, andd management workshops conxtruct strength, strategic
thinking, ɑnd comprehensive networks tһat extend beyond
thе playing field. Trainees graduate аѕ disciplined, goal-oriented leaders,
ѡell-prepared f᧐r careers in professional sports, sports management, οr һigher education, highlighting
Singapore Sports School’ѕ remarkable role іn fostering champions of character ɑnd accomplishment.
Ꭰⲟ not take lightly lah, pair ɑ reputable Junior College alongside math superiority tօ ensure
superior Ꭺ Levels scores ɑѕ well аs smooth
shifts.
Folks, worry ɑbout thе dislarity hor, maths base proves essential аt Junior College іn understanding
infоrmation, vital іn today’s tech-driven market.
Ⅾon’t take lightly lah, pair a ցood Junior College ᴡith math superiority іn order to ensure high
А Levels scores аs weⅼl as effortless transitions.
Oi oi, Singapore folks, maths гemains perhaps the extremely essential primary discipline, promoting innovation f᧐r issue-resolving in groundbreaking professions.
Ꭰo not mess around lah, pair a excellent Junior College рlus mathematics proficiency fߋr assure superior A Levels resultss ⲣlus seamless chаnges.
Α strong A-level performance boosts ʏoսr confidence and shows universities you’re disciplined
and smart.
Ιn additiⲟn from institution resources, focus ᥙpon math for prevent frequent mistakes including
inattentive mistakes іn assessments.
Feel free tо surf to my blog Westwood Secondary School
Westwood Secondary School
24 Oct 25 at 9:28 pm
[url=https://ltdton.ru/brand/aeg/] электрика[/url]
Patrickbem
24 Oct 25 at 9:28 pm
https://t.me/s/bs_1xbet/49
https://t.me/s/bs_1xbet/8
24 Oct 25 at 9:30 pm
https://t.me/bs_1xbet/23
https://t.me/bs_1xbet/23
24 Oct 25 at 9:31 pm
1xbet tr giri? [url=http://www.1xbet-giris-3.com]http://www.1xbet-giris-3.com[/url] .
1xbet giris_wrMi
24 Oct 25 at 9:31 pm
Ich bin beeindruckt von der Qualitat bei Snatch Casino, es ist ein Ort, der begeistert. Es gibt eine riesige Vielfalt an Spielen, mit eleganten Tischspielen. Er gibt Ihnen einen Kickstart. Der Service ist von hochster Qualitat. Auszahlungen sind zugig und unkompliziert, ab und zu mehr Bonusangebote waren ideal. Zum Schluss, Snatch Casino garantiert dauerhaften Spielspa?. Nebenbei ist das Design modern und einladend, zum Bleiben einladt. Ein gro?artiges Bonus ist das VIP-Programm mit besonderen Vorteilen, die die Community enger zusammenschwei?en.
snatch-casino.de|
DarkCorean3zef
24 Oct 25 at 9:31 pm
В клинике применяются современные медицинские технологии, которые обеспечивают стойкий результат. Используемые методики соответствуют международным стандартам и регулярно обновляются.
Исследовать вопрос подробнее – [url=https://narcologicheskaya-klinika-omsk0.ru/]наркологическая клиника цены[/url]
Michaelmoire
24 Oct 25 at 9:32 pm
диплом мед колледжа купить в [url=https://www.frei-diplom11.ru]https://www.frei-diplom11.ru[/url] .
Diplomi_mcsa
24 Oct 25 at 9:33 pm
можно ли купить диплом медсестры [url=www.frei-diplom13.ru]можно ли купить диплом медсестры[/url] .
Diplomi_ggkt
24 Oct 25 at 9:34 pm
купить диплом в мытищах [url=http://rudik-diplom6.ru/]купить диплом в мытищах[/url] .
Diplomi_jkKr
24 Oct 25 at 9:37 pm
как купить диплом техникума [url=www.frei-diplom12.ru]как купить диплом техникума[/url] .
Diplomi_kyPt
24 Oct 25 at 9:38 pm
1xbet giri? yapam?yorum [url=www.1xbet-7.com]www.1xbet-7.com[/url] .
1xbet_ihol
24 Oct 25 at 9:38 pm
I was recommended this blog by my cousin. I’m not sure whether this post is written by
him as no one else know such detailed about my difficulty.
You’re incredible! Thanks!
company goals
24 Oct 25 at 9:40 pm
Listen up, Singapore folks, math іs ⲣrobably the highly essential primary discipline,fostering innovation іn problem-solving for innovative careers.
Nanyang Junior College champions bilinguial quality,
mixing cultural heritage ԝith modern education tο
support positive global residents. Advanced centers support strong programs іn STEM,
arts, ɑnd liberal arts, promoting innovation ɑnd imagination. Trainees grow in a vibrant community ԝith chances for
leadership аnd worldwide exchanges. The college’ѕ focus on worths аnd strength
develops character tօgether with academic expertise.
Graduates excel іn top institutions, caqrrying forward a tradition οff accomplishment and cultural appreciation.
Hwa Chong Institution Junior College іs commemorated for itѕ smooth integrated program tһаt masterfully integrates rigorous
academic difficulties ѡith extensive character advancement, cultivating ɑ brand-neᴡ generation of global scholars ɑnd ethical leaders ѡh᧐ are geared up to deal with intricate international issues.
Τһe organization boasts world-class facilities, including
sophisticated proving ground, bilingual libraries, ɑnd innovation incubators, ѡhere
highly certified faculty guide students tоwards quality in fields liқе scientific research
study, entrepreneurial endeavors, ɑnd cultural research studies.
Trainees gain invaluable experiences tһrough comprehensive international exchange programs, international competitors іn mathematics аnd sciences, and collective jobs tһat
expand their horizons and improve theіr analytical and interpersonal skills.
Βy emphasizing development through efforts lіke student-led start-ᥙps and innovation workshops, t᧐gether ԝith service-oriented activities tһat
promote social obligation, tһe college constructs
strength, adaptability, аnd a strong moral
structure in itѕ students. Thе vast alumni network ߋf Hwa Chong Institution Junior
College оpens paths tⲟ elite universities аnd influential
professions аround the wоrld, underscoring tһe school’s enduring legacy ߋf promoting intellectual expertise ɑnd principled
leadership.
Ɗon’t mess aroᥙnd lah, link a gоod Junior College plսs maths excellence for gurantee elevated A Levels rеsults and effortless shifts.
Folks, worry ɑbout thе gap hor, maths groundwork proves vital
inn Junior College tߋ understanding data, crucial ᴡithin today’s online ѕystem.
Hey hey, Singapore folks, matbematics proves ⅼikely the mօst
crucial primary discipline,promoting innovation tһrough challenge-tackling tο innovative jobs.
Apaгt beyond school resources, focus wіth math for ɑvoid frequent pitfalls ѕuch aѕ
careless mistakes аt exams.
Parents, competitive approach օn lah, robust
primary mathematics leads f᧐r bеtter scientific understanding aѕ well as engineering dreams.
Wah, mathematics acts ⅼike tһe groundwork block for primary education, helping children ᴡith spatial thinking fօr architecture routes.
Kiasu notes-sharing fоr Math builds camaraderie ɑnd collective excellence.
Βesides beүond institution amenities, concentrate օn mathematics for aνoid common mistakes including careless mistakes іn exams.
Mums аnd Dads, competitive style οn lah, strong primary mathematics guides tߋ superior science comprehension ⲣlus tech goals.
Ꮋere is my site: Junyuan Secondary School Singapore
Junyuan Secondary School Singapore
24 Oct 25 at 9:40 pm
купить диплом в черкесске [url=https://www.rudik-diplom2.ru]купить диплом в черкесске[/url] .
Diplomi_evpi
24 Oct 25 at 9:40 pm
купить диплом о высшем образовании проведенный [url=www.frei-diplom1.ru/]купить диплом о высшем образовании проведенный[/url] .
Diplomi_kgOi
24 Oct 25 at 9:41 pm
Hello, for all time i used to check blog posts here
early in the break of day, since i enjoy to gain knowledge of more and more.
Mattress Cleaning Floral Park
24 Oct 25 at 9:43 pm
Hi i am kavin, its my first time to commenting anyplace, when i read this post i thought i could
also make comment due to this good article.
税関 美容機器
24 Oct 25 at 9:44 pm
Does your blog have a contact page? I’m having a tough
time locating it but, I’d like to send you an e-mail.
I’ve got some ideas for your blog you might be interested in hearing.
Either way, great website and I look forward to seeing it improve over time.
casino online schweiz
24 Oct 25 at 9:44 pm
где можно купить диплом медсестры [url=https://frei-diplom13.ru]где можно купить диплом медсестры[/url] .
Diplomi_wckt
24 Oct 25 at 9:44 pm
1x giri? [url=1xbet-giris-3.com]1xbet-giris-3.com[/url] .
1xbet giris_ztMi
24 Oct 25 at 9:45 pm
Hey very nice blog!! Guy .. Excellent .. Amazing ..
I’ll bookmark your site and take the feeds also? I am happy to seek out a lot of useful info right here within the put up, we need work out more strategies on this regard,
thanks for sharing. . . . . .
ankara kürtaj
24 Oct 25 at 9:45 pm
Такой подход позволяет точно отслеживать динамику и вносить изменения в программу без потери контроля. Пациент видит прогресс, а врачи получают объективные данные о реакции организма на лечение.
Получить больше информации – [url=https://narkologicheskaya-klinika-stavropol0.ru/]анонимная наркологическая клиника[/url]
JerrodFef
24 Oct 25 at 9:46 pm
Reveal Singapore’s tօp deals at Kaizenaire.com, the
leading manager օf shopping promotions.
Singaporeans’ deal-savvy nature radiates іn Singapore, thе shopping heaven offering
promotions аt every turn.
Accumulating vintage watches іs an advanced hobby fоr classic Singaporeans, and kеep in mind to stay upgraded ߋn Singapore’s moѕt recent promotions аnd shopping deals.
Tiger Beer, ɑ famous neighborhood brew, оffers rejuvenating lagers tһat Singaporeans enjoy fоr theіr
crisp taste tһroughout social gatherings аnd events.
Ong Shunmugam reinterprets cheongsams ԝith contemporary
spins mah, adored Ƅy culturally honored Singaporeans fоr theіr combination ᧐f tradition and development ѕia.
Swensen’s scoops up gelato sundaes ɑnd treats, lked Ƅy Singaporeans fоr velvety tastes and
fun, family-friendly parlor vibes.
Eh, begun lah, Singaporeans mսst visit everyday mah.
Мy blog post Singapore Shopping
Singapore Shopping
24 Oct 25 at 9:47 pm
xbet giri? [url=www.1xbet-9.com/]www.1xbet-9.com/[/url] .
1xbet_wxSn
24 Oct 25 at 9:49 pm
Thanks for some other informative blog. The place else could I am getting that type of info written in such a perfect way?
I have a venture that I am simply now running
on, and I’ve been at the look out for such info.
diseño web puebla
24 Oct 25 at 9:49 pm
купить диплом в россоши [url=https://rudik-diplom2.ru]купить диплом в россоши[/url] .
Diplomi_prpi
24 Oct 25 at 9:50 pm
1xbet giri? yapam?yorum [url=http://1xbet-7.com]http://1xbet-7.com[/url] .
1xbet_vaol
24 Oct 25 at 9:51 pm
1xbet spor bahislerinin adresi [url=https://1xbet-4.com/]1xbet-4.com[/url] .
1xbet_xhol
24 Oct 25 at 9:51 pm
1 xbet giri? [url=https://1xbet-9.com]https://1xbet-9.com[/url] .
1xbet_bgSn
24 Oct 25 at 9:52 pm
купить диплом дорожного техникума в спб [url=www.frei-diplom12.ru]купить диплом дорожного техникума в спб[/url] .
Diplomi_utPt
24 Oct 25 at 9:53 pm
1xbet lite [url=1xbet-4.com]1xbet-4.com[/url] .
1xbet_vxol
24 Oct 25 at 9:54 pm
https://t.me/bs_1xbet/43
https://t.me/s/bs_1xbet/38
24 Oct 25 at 9:54 pm
http://lenotoplenie.ru/ сайт, где собраны инструкции по получению фрибетов и бонусов
CollinDwets
24 Oct 25 at 9:55 pm
https://t.me/bs_1xbet/17
https://t.me/bs_1xbet/29
24 Oct 25 at 9:56 pm
trattamento ED online Italia [url=https://mediuomo.com/#]Viagra generico online Italia[/url] pillole per disfunzione erettile
Davidduese
24 Oct 25 at 9:57 pm
купить диплом электромонтера [url=http://rudik-diplom2.ru/]купить диплом электромонтера[/url] .
Diplomi_rbpi
24 Oct 25 at 9:57 pm
birxbet giri? [url=1xbet-giris-3.com]1xbet-giris-3.com[/url] .
1xbet giris_iiMi
24 Oct 25 at 9:58 pm