Newsgroups: php.internals
Path: news.php.net
Xref: news.php.net php.internals:126361
X-Original-To: internals@lists.php.net
Delivered-To: internals@lists.php.net
Received: from php-smtp4.php.net (php-smtp4.php.net [45.112.84.5])
	by qa.php.net (Postfix) with ESMTPS id 674E31A00BC
	for <internals@lists.php.net>; Sun,  9 Feb 2025 13:58:09 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail;
	t=1739109324; bh=X7G9HR1KChjXmzCXgsX/uOxatlclpPAktOstAhSP0BE=;
	h=Date:Subject:To:References:From:In-Reply-To:From;
	b=H2vSEn1gSUCjj7bB+QkKf4nPEiJb25ol5yBTXKfDJToD/j7aMXWTktR/o7KwrYlHp
	 tZm6RZxZ3mtMBdGYOw5rYdagv87RBMTxxhIBJ5oNWa19siOla2ItOem6siV2x2Zp2K
	 0PrIcVgXqp+LdsyCr1/d10WRXpZDKqmy4zHHWIGYlM4f3XwN8HgvamUaQy0nAatUkn
	 Kg7npLESMLuGiXNHRhaCI2mAjPiB0GiEEufIVY+iyEbvw2VM39Jm9PBFevGw+Ud54a
	 JprdYdCdBbYJMHsMaD2MML/gjIK2XLUF2i6UYzeZisFx1JOhxyKZ7ic8wBqWgvDq7Z
	 J9lJvEpjN88xg==
Received: from php-smtp4.php.net (localhost [127.0.0.1])
	by php-smtp4.php.net (Postfix) with ESMTP id E0EA9180558
	for <internals@lists.php.net>; Sun,  9 Feb 2025 13:55:23 +0000 (UTC)
X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on php-smtp4.php.net
X-Spam-Level: 
X-Spam-Status: No, score=-1.0 required=5.0 tests=BAYES_50,DKIM_SIGNED,
	DKIM_VALID,DMARC_MISSING,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,
	SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=4.0.0
X-Spam-Virus: No
X-Envelope-From: <bilge@scriptfusion.com>
Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com [209.85.128.53])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256)
	(No client certificate requested)
	by php-smtp4.php.net (Postfix) with ESMTPS
	for <internals@lists.php.net>; Sun,  9 Feb 2025 13:55:22 +0000 (UTC)
Received: by mail-wm1-f53.google.com with SMTP id 5b1f17b1804b1-436326dcb1cso23113105e9.0
        for <internals@lists.php.net>; Sun, 09 Feb 2025 05:58:07 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=scriptfusion-com.20230601.gappssmtp.com; s=20230601; t=1739109486; x=1739714286; darn=lists.php.net;
        h=content-transfer-encoding:in-reply-to:from:content-language
         :references:to:subject:user-agent:mime-version:date:message-id:from
         :to:cc:subject:date:message-id:reply-to;
        bh=22ydrLrCYuQ+AtIfxxES9B9urd5oio8aIJuGGOk87So=;
        b=0pUjx5qvBZbqFVn3U92ZphPmARHgvngtOAcUQMiiQjywsO6tSdN1r58mcyC6hkgQM/
         erIJqQhjV20vYv5YDz1EOmlmRNQI9bZfdV6mFzQi41JzR42gD/Yo5mt5F/o9iwe32mG4
         pAc4Eoq0yNhpOcMT4wJhkJvQw3uKOk8m3zbhmT0GxWnC0FPU4372mx3tFk6S+e2Kcnwd
         QhjOukUMf3lt8tRTmkvncWPA1tLL70BMk+6/D6YuUS/zPPg8KYP5qUUv2sc+THbLEL9u
         DFGcuWq+3YNiGb5KZfAnonefW8gl26LH41RuJ+3NWJt8QzC6p1jp9i1+3930ZOGMOM/f
         UpNw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1739109486; x=1739714286;
        h=content-transfer-encoding:in-reply-to:from:content-language
         :references:to:subject:user-agent:mime-version:date:message-id
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
        bh=22ydrLrCYuQ+AtIfxxES9B9urd5oio8aIJuGGOk87So=;
        b=N4E4bUbovc6hffVZwIJAVjb0/6X2/vtXl7gZ298JGpeSZyY5clZA9jdzQTjtfXYOkR
         zEGagNRlaG2LAaunBqIjNTcDg8h460Xc3+iLItIVKNA7rPfbaGKgyQVA/FKMdrwu7xtl
         YwhmSi0AkHcjmLoS4NaMBh0yTiqRsEyxYRu860VaJ6WWCe+/u/rtYp+IBGWZiNlbX1Hv
         BEli+xJfFZ1ljDj3453Nq4cO2bf1pEy/7T6U1+StmKhWrFcF6pASqpHNsgDJ3obqgH/x
         eANNhd5CSyuwtBZHkN04Bh3qDV6oh75henZxQjcVgdhFYKEHhsXs119iEjYePw3VcOxW
         FNKA==
X-Gm-Message-State: AOJu0YwI8o90KffyGzSbqhEZOChPzS9fEmuuJ5spWpjczCmHE6z5vs2l
	wrqbJCnaGf6ZqDnqo+YTbDbtb4EtB5smOGEpm/OTPY12x4G1emohgoR/jgK/bn0JaeDUyNcz9Dy
	1
X-Gm-Gg: ASbGncvZmeMRkue2fe2Y/aqYxfmhyz25gH6x56CHSg8Yg+WJzBlNl97Z26b/5xLpuAQ
	h9TltBtEwrI8DZtXkDkNQaeoWlWU2oQfjfh4/3cY/QAuSgrjtVOWl17gkm0NgQvWKBa8u3ZkPDk
	TktxcHzadVbhbozS90KrJdwKlcf3kl6TYYJgAA4N4maWn2nlVx/ofiSHOKv3OpQzzcIGsVOzhRQ
	i5kuhmvM8pBLz2G2s+f08iRvoqfz6B86mZ5mP2lnK8Xpsjo9BusudEnwgAWItixILjXa+FgSlAD
	gYbDeE5mDy4WPbxxPAdar6uDWiTn8IvGSuNnV8h+2yGix92Ps5DS2breVvIZO+vthpbaUhpIGuU
	=
X-Google-Smtp-Source: AGHT+IGN2OFepF4xH2SP5bjUA6uPUdIDV4h/dqVGv86Z7calmF4EW4wJSK0R9Ug0yTppTz/tJvkknA==
X-Received: by 2002:a05:600c:1e12:b0:439:3ba0:d578 with SMTP id 5b1f17b1804b1-4393ba0d71dmr27676405e9.11.1739109485869;
        Sun, 09 Feb 2025 05:58:05 -0800 (PST)
Received: from ?IPV6:2a01:4b00:bf09:5101:6086:adaa:d803:fe59? ([2a01:4b00:bf09:5101:6086:adaa:d803:fe59])
        by smtp.googlemail.com with ESMTPSA id 5b1f17b1804b1-4391dca0041sm114330955e9.14.2025.02.09.05.58.03
        for <internals@lists.php.net>
        (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
        Sun, 09 Feb 2025 05:58:04 -0800 (PST)
Message-ID: <98097b17-7cfc-43c0-adc3-3f68df2f0145@scriptfusion.com>
Date: Sun, 9 Feb 2025 13:58:03 +0000
Precedence: bulk
list-help: <mailto:internals+help@lists.php.net
list-unsubscribe: <mailto:internals+unsubscribe@lists.php.net>
list-post: <mailto:internals@lists.php.net>
List-Id: internals.lists.php.net
x-ms-reactions: disallow
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PHP-DEV] Introduction - Sam Lewis
To: internals@lists.php.net
References: <CAD91n9L6B7fe1wtqqeOH+6PT1so-+TxB3uOEuVDL7W5T+U27Lw@mail.gmail.com>
 <8053193b-0637-4db4-825d-56e7746111dd@bastelstu.be>
 <e0ef2efc-2933-451a-9259-b6c9d5491bdf@app.fastmail.com>
 <CAD91n9KpV+G8WpJAcjmUb_yYnzXf6Ev7NE-w=8or5Uh-7GWZ8Q@mail.gmail.com>
 <88486267-f5e5-485b-bce1-e30163b5e703@bastelstu.be>
 <CAD91n9LznWqt35p0NjHp9geD8HswATQb3LQitc14gUBVqrhAhA@mail.gmail.com>
 <CAM0Ccxj-mKEWwa3AW-3ZNsTgvZ9HBKE7b7UqW45R-yZ2J-y3Dg@mail.gmail.com>
Content-Language: en-GB
In-Reply-To: <CAM0Ccxj-mKEWwa3AW-3ZNsTgvZ9HBKE7b7UqW45R-yZ2J-y3Dg@mail.gmail.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
From: bilge@scriptfusion.com (Bilge)

On 08/02/2025 19:52, Eugene Sidelnyk wrote:
> Hi Sam, Tim, Rob
>
> Maybe there could be another good feature to start with - the function 
> to format bytes into a human-readable format (for debug purpuses) to 
> have pretty view of the size (like 1.5GB, or 20MB)
>
> Right now every time I need this, I find myself copying the function 
> from stack overflow, since PHP doesn't have any built-in solution: 
> https://stackoverflow.com/questions/2510434/format-bytes-to-kilobytes-megabytes-gigabytes
>
> This is too little thing for having separate composer library, and 
> perhaps having it built-in would be better?
>
> What do you think?

https://github.com/ScriptFUSION/ByteFormatter/